I noticed a new feature with the Rigid Body component, 'Collision Detection'. I have it set to Continuous and it is unstable!
The code that I have is defined in my PlayerMoveScript C# file:
so I referece the ON_TRIGGER bool type in another script:
I get true, false, true, false, true, false when I am ON the game object and when the RigidBody->Collision Detection feature is set to Continuous, Discrete or Continuous Dynamic.
Is this a performance issue? It worked fine in 2.6.1 (without this additional feature)
The player has these components attached:
MeshRenderer (which really doesn't have anything to do with CD) RigidBody (with Collision detection to Discrete) Capsule Collider
The game object has these components attached:
MeshCollider MeshRenderer RigidBody (with CD to discrete)
is there a mismatch or something? The player has a child object "bodyMesh" with the same components.
When you use a rigidbody u need to consider to use FixedUpdate() rather than Update(), behaviour like the one you described can occur due to slight difference in the timing for the PhysX engine components.
It's all a very precisely tuned clock and when checking for collisions using Continous collision detection you are asking the machine to check a lot more, specifically usefull for checking FAST moving objects, but it costs a lot of effort, having to tune all the time would make for a lot of extra work so Unity3D assumes you want best performance with collision detection unless you need a more specific check for precise calculation (Which in my opinion is a wise decisions).
Unless the objects are going very fast don't use Continuous or ContinuousDynamic collision detection systems. And when using a rigidbody, use FixedUpdate wherever possible, even though I have to admit I am not always doing so myself, I'm not fully confident I understand what is going on when I do use it and I do not like that at all.
Also see the user manual references for more on this
Hope it helps :)
I'm having some serious problems understanding just what is going on under the hood with all the collisions and who's calling what. The Unity3D actors are making it tricky for me. Used to doing all the work myself now it's gotta match the engine and components build that exists so it's quite easy to get lost in the maze.
Just keep backtracking and asking where it went wrong if you can't get out!
answered Nov 10 '10 at 09:31 AM