This page describes which event functions Unity generates based on the configuration of each collider in a collision pair.
When a pair of colliders make contact, they generate collision detection messages if the following are both true:
The following table describes each combination of collider types. A “Y” indicates a combination that can generate collision detection and collision messages.
Collision detection occurs and messages are sent upon collision | ||||||
---|---|---|---|---|---|---|
Static collider | Dynamic collider | Kinematic collider | Static trigger collider | Dynamic trigger collider | Kinematic trigger collider | |
Static collider | 是 | |||||
Dynamic collider | 是 | 是 | 是 | |||
Kinematic collider | 是 | |||||
Static trigger collider | ||||||
Dynamic trigger collider | ||||||
Kinematic trigger collider |
Remember that Unity only applies physics forces to collider GameObjects that have a physics body (a Rigidbody or ArticulationBody). When a physics body collider collides with a static collider, only the physics body collider behavior changes as a result of the collision (for example, it might bounce or slow down as a result of the collision).
Trigger messages occur in the following circumstances:
The following table describes each combination of collider types. A “Y” indicates a combination that can generate trigger messages from any trigger collider in the pair.
Trigger messages are sent upon collision | ||||||
---|---|---|---|---|---|---|
Static collider | Dynamic collider | Kinematic collider | Static trigger collider | Dynamic trigger collider | Kinematic trigger collider | |
Static collider | 是 | 是 | ||||
Dynamic collider | 是 | 是 | 是 | |||
Kinematic collider | 是 | 是 | 是 | |||
Static trigger collider | 是 | 是 | 是 | 是 | ||
Dynamic trigger collider | 是 | 是 | 是 | 是 | 是 | 是 |
Kinematic trigger collider | 是 | 是 | 是 | 是 | 是 | 是 |