How to use OnCollisionEnter:
1. Make sure both of your gameObject has Mesh Collider and Rigidbody, and rigidBody.isKinematic must be FALSE.
2. In one of your gameObject script, just write
function OnCollisionEnter(other : Collision)
{
if(other.gameObject.name == "another_gameObject_name")
{
print("Hit another_gameObject !");
}
}
↧