- Home /
Object's pass through each other?
OK so this has always been a main problem when I use unity. Object's simply pass through each other even when they have colliders and they are not triggers. I tried adding a rigidbody but the movement for my main character is to buggy. So what am I missing? Anything will help thanks a bunch!
Answer by syclamoth · Feb 11, 2012 at 06:48 AM
For Unity to correctly detect collisions, at least one object involved must have a non-kinematic rigidbody. If you are moving objects around, and you want them to respond correctly to physics, you must A: put a rigidbody on them and B: move them via the 'rigidbody.AddForce' method.
If your movement is performed by either overriding transform.position or using transform.Translate, the result will not be adjusted by physics. The only effect this will have on physics simulation is the displacement of other rigidbodies that it comes into contact with.
If your object cannot have a rigidbody (for whatever reason), you will have to write your own collision detection algorithms. A collider alone does not manage physics- all it does is provide an object for rigidbodies to interact with.
Answer by luozitian · Feb 11, 2012 at 06:48 AM
rigidbody is a must on at least one object for collider detection.And you can add the rigidbody to other object instead of your character.
Your answer
Follow this Question
Related Questions
OnCollisionStay is inaccurate 3 Answers
Scene control toolbar not displaying properly 2 Answers
Bullets Not Deleted Upon Collision 1 Answer
Destroying object when player walks over it 1 Answer
Animation freezes on TriggerStay2D 0 Answers