OnCollision or OnTrigger?
To expand our physics abilities in Unity now that we have a Rigidbody and Collider on our objects we can use methods that allow us to deal with the results of those collisions.
The first is OnCollisionEnter(), this method provides information about where the collision occurred, the velocity of the impact. With this information we can deal with things like ricochets, knockbacks, or impact damage. Let’s look at the…