- Home /
how to detect Collision with out having a RigidBody ?
how to detect Collision without assigning rigidBody?
Answer by ronaldosilva · May 04, 2012 at 04:03 PM
Its very easy. Actually rigid bodies are used to make your object be influenced by physics forces, like gravity, acceleration and etc. You can detect collisions using both rigid bodies or box colliders. Just search for Box Colliders on Unity documentation and you will have a very nice example.
http://unity3d.com/support/documentation/Components/class-BoxCollider http://unity3d.com/support/documentation/ScriptReference/Collider.OnCollisionEnter.html
Answer by xtplpune · May 08, 2012 at 10:34 AM
Thanks For Helping..... But i want to detect Collision when two cubes(they don't have RigidBodies) are touched......
But In Reference... If you are moving an object through its Transform component but you want to receive Collision/Trigger messages, you must attach a Rigidbody to the object that is moving.
means,for detecting collision, is Rigid Body is must and should ?
You do not need to have a RigidBody unless you want to use Unity's physics to handles collisions.
Look at the links provided by ronaldosilva. You can attach a Collider to your game object to detect collisions and handle the response yourself in OnCollisionEnter().
Your answer