Hi, can i ask for a good method on collision with the environment? It there some kind of script that make this? Or is there a logic bricks set up that makes the physic less glitchy? Anyone has a good set up?
If your Problem is that several Evironment Objects are too complex and therefore result in glitchy Physics Interaction, make these Objects NoCollision and pull some simpler Binding Boxes around them. Generally a rather good Idea.
Is that a typo? Is that suppose to be a bounding box? or really a Binding box? How could I do that?
As C.A.ligári points out, complex shapes cause the Bullet physics to do odd things, and simpler collison shapes means the engine has less work to do.
Have your detailed mesh set to no collision, and parent this to a box (or approximate low polygon shape) set to invisible. As you play, the player sees the detailed mesh, but the invisible outer box is used for collisions.
You can also set the collision bounds in the physics tab to a simpler shape (like cube, sphere, etc as well as per polygon collision), and increase the margin around the bounding box.
Also, you can play with the Radius attribute and Form Factor (also in the physics tab).
‘twas a Typo, sorry – was early in the Mornin’ back then, for me. : P
Isn’t using the bounds makes the physics go WAY up? I tried it earlier in my game. My character goes 3 dimensional, so… Uhm, could i add a property to the environment and make it that the player would react to that property? But i think that would require a lot of logic bricks. Any scripts that might help? Or does anyone know a better physics with the environment set up? It would totally help.
You need to set the bounds on objects to tell the physics engine what shape the objects are (or else blender does it itself?), and the more complex the meshes are that collide the more performance gets used trying to calculate the collisions correctly. The simpler the bounds are, the better. E.g. Two complex characters collide, blender will try to calculate the collision for each of the faces on the mesh that collide, but if you had it set to ‘box’ there would be an invisible box around the shape that would collide instead, made up of only 6 sides, with only one colliding.
As the others have said, try to set the bounds on objects to best match their shape with simpler shapes. A rock would be ‘sphere’, a log ‘cylinder’, a bush ‘no collision’ if you want to walk through it(not ghost, it still counts a collision!) a tree might have a simple cylinder at its base where the player can walk to, with the tree mesh being set to no collision.
Also, objects below 1 blender unit have less accurate physics.
Hope this helps
If you have a state change when you hit a certain texture, like look up wall,
this can do 2 things, stop the movement except for backwards with constraints or a collision and set up new behaviors, like wall jump etc* like if I am touching the floor and wall trigger state Named_state.
You do not need boundary on environment elements. They just needs to be static. Active physics objects will be with their faces.
Only active objects (dynamic/rigid body/softbody) need a boundary. It that case it is not simple environment anymore but an active part of the game. With the boundary you can set simpler shapes for physics as alternate “mesh”. The physics engine ignores the visual mesh in that case.
Keep the number of active objects as low as possible. They are performance eater.
As Monster pointed it out, I want to point out that with Drawing a Bounding Box I actually did mean (like Monster said) manually pulling a simple Static Shape over the more complex Shape, and NOT (except for active Objects) the Bounding Box in the Physics Options. And that does not drag the Physics down, it rather is a huge Benefit for 'em!
Okay okay. UHm. So from what I’ve just read from you guys. Using bounds is only for rigid body/dynamics, etc. Right? And that using simpler objects is good for the physics. You guys telling me what to avoid. But How do I exactly fix the problem. “My character being able to run through static actor objects.” How am i going to set the environment up?
Oh that is your problem?
Is your character a physics object?
How do you move it?
My character’s armature is parented to a bounding box. I use that bounding box to move my character. It’s a dynamic.
There are two Definitions of »Bounding Box«:
Dynamic, Rigi Body, Soft Body.
These have a »Collision Bounds« Option that can be set. That is important for both: Proper Physics and keepin’ them low as well.
As a Default, »Triangle Mesh« would be used as Collision Bound. That can be a rather heavy Type. So to simplify the Physics on an Object you would set them – like mentioned above, a Stone with its wobbly, edgy Shape might resemble a Sphere more or less, so you would make the Stone a simple Sphere instead of havin’ the Physics calculate all its Dozens of Triangles.
Static Objects ==> No Collision & Static+Invisible
Generally, your Environment would consist of Static Objects. Rather complex Shapes like Stairs or edgy Hills are likely to result in glitchy Physics, so you would make such Parts of your Environment NoCollision instead of Static and then pull a simpler Shape over them, keep that one Static and set it to Invisible.
Maybe you just have a Movement or Physics Setup for Beck that makes him glitch through Walls? Maybe then you would have to play around with Radius, Margin, Form Factor and all these little Options for Beck’s Collision Box.
edit: And of Course, no Loc Motion. ;}
The main reason for glitch in collision is using loc for movements. Velocity, force or servo control works better with physics and servo control make a 0 speed ‘still’ actuator possible to avoid sliding . Making complex environment no-collision and create an invisible simpler collision mesh will help performance and might reduce glitch.
Oh. That explains it. So how do I avoid sliding with servo control? With no use of states?
When the player do not press any control activate a servo actuator with 0 speed. When using servo control You may want to limit force on z axis to 0 to not prevent Your character from falling.
update: if I misinterpreted Your question - A nor controller will give You that - go true when no input is true. Due to a logic bricks glitch it will not be true at game start thou… but that usually don’t hurt much. How it behave on state shift I don’t know - there might be problems at rear occasions.
I write one giant Post with all Sorts of Blabbering around the actual Point and just the tiny, lil’ Edit Note is your actual Problem.
So sorry. :\ But I really do understand your earlier posts. The more complex to the more simpler meshes. UHm. Could anyone just have a very simple blend for my problem? Just a servo control blend that makes my player go 3 dimensional. I hope anyone would be nice enough though.
What kind of character - dynamic always with the ‘head’ up or rigid body following the ground in orientation?
What kind of movements? fw, bw, right, left or fw, bw, rotate left and right?
What do You mean with 3D movements - following the grounds altitude or some kind of flying?