On Collision Enter
Physics & collisionsDetailedOnCollisionEnter
A non-player collider hits this one (needs a Rigidbody on one of them).
Happens when this object's collider starts touching another collider. Both must have Is Trigger off, and at least one needs a Rigidbody with Is Kinematic off. So nothing happens between a kinematic object and a floor without a Rigidbody.
What hit it is a Collision: data about the contact points, the impact speed and so on.
The trigger can sit on either side. When a box with a Rigidbody falls onto the floor, it fires on a trigger on the floor and on a trigger on the box.
To notice players hitting it, use On Player Collision Enter.
Official docs: OnCollisionEnter (Unity), Interaction between collider types (Unity)
Event values
Values this event has; action settings can use them as targets or values.
| Name | Type |
|---|---|
| What hit it | Collision |
On a card
In Udon
In UdonSharp, this is the method:
void OnCollisionEnter(Collision other)In the same category
- On Player Collision Enter
- On Trigger Enter (Collider)
- On Trigger Exit (Collider)
- On Player Trigger Stay
- On Player Collision Exit
- On Player Collision Stay
- On Player Particle Collision
- On Controller Collider Hit Player
- On Trigger Stay (Collider)
- On Collision Exit
- On Collision Stay
- On Trigger Enter 2D
- On Trigger Exit 2D
- On Trigger Stay 2D
- On Collision Enter 2D
- On Collision Exit 2D
- On Collision Stay 2D
- On Controller Collider Hit
- On Particle Collision
- On Particle Trigger
- On Joint Break
- On Joint Break 2D
- On Parent Changed
- On Children Changed