Collision

From ETC Public Wiki
Jump to: navigation, search

Overview


  • To trigger collision events when 2 objects collide, you would need to have a Collider (Triggered) on both objects, and apply a Rigidbody to one of them to trigger the event.
  • Depending on what kind of Colliders you are using, you would use OnTrigger, or OnCollision functions. See Collision Chart for more information (taken from the Unity website).
  • Both OnTrigger, and OnCollision functions have 3 methods. OnTriggerEnter, OnTriggerExit, and OnTriggerStay. OnCollisionEnter, OnCollisionExit, and OnCollisionStay.
Collision Chart