On Trigger Enter (Collider)
Physics & collisionsDetailedOnTriggerEnter
A non-player collider enters this trigger.
Happens when another collider enters this object's area (a collider with Is Trigger on). It is a Unity physics event, called during the physics update (FixedUpdate). What entered is the collider that came in.
Both objects need a collider, at least one of them with Is Trigger on, and one of them needs a Rigidbody. In Unity's interaction table, an area with a Rigidbody reacts to any collider. An area without one reacts only to objects with a Rigidbody (a kinematic one is fine).
Unity sends the event both to the area and to the collider that came in, so it also fires on a trigger that isn't the area. Put a trigger on a ball, for example, and it fires when the ball enters the goal's area.
To notice players coming in, use On Player Trigger Enter.
Official docs: OnTriggerEnter (Unity), OnTriggerExit (Unity), Interaction between collider types (Unity)
Event values
Values this event has; action settings can use them as targets or values.
| Name | Type |
|---|---|
| What entered | Collider |
On a card
In Udon
In UdonSharp, this is the method:
void OnTriggerEnter(Collider other)In the same category
- On Player Collision Enter
- 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 Enter
- 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