Detect collision on object

Hey guys,

I need to detect collision on my object?

Please help me !!!


  1. Add a collider component. Any one of them will do.

  2. Add a rigidbody component. This tells the Physics engine to control it.

  3. Attach a script to your object.

  4. Insert the following lines into your script.

  5. Read the user manual. We are glad to help you if you get stuck, but this question could be fairly easily answered just by looking through the docs a little.

function OnCollisionEnter ( /*Optional collision parameter*/ ) {
     //Use the collision to get info about what and where we hit.

     Debug.Log("You hit an object");