One: Collision conditions 1: To create a collision, both sides must have a collider. 2: The movement of the party must have a rigid body, the other side has no rigid body does not matter. Note: If the moving side has no rigid body, it collides with the stationary rigid body, which is equivalent to not being mounted.
Two: Contact 1:collision collision, resulting in physical collisions, you can perform the Oncollision event at the time of the collision. 2:trigger triggers, cancels all physical collisions, and can execute Ontrigger events when triggered. Note: Two-object contact is not possible to produce a collision + contact at the same time. However, a collision can occur with AB, and AC generates a trigger.
Three: conditions that produce different ways of contact 1:collision collision (1): Both sides have a collision body (2): The movement of the party must have a rigid body (3): The two sides can not simultaneously tick kinematic kinematics. (4): Trigger trigger cannot be checked on both sides. 2:trigger Trigger (1): Both sides have a collision body (2): The movement must be a rigid body (3): At least one side tick trigger trigger
Four: After contact the event is subdivided into enter,stay,exit three kinds (take trigger as an example, Ontriggerenter, Ontriggerstay, ontriggerexit respectively) 1:enter event indicates that two objects contact instantaneous, will execute once. The 2:stay event indicates that the two objects are continuously in contact and will continue to execute. 3:exit event when two objects are separated for an instant, they are executed once.
V: Collision Rules Table
Collision detection and sending messages during a collision |
|
Static colliding body (static Collider) |
Rigid Body Collider (Rigidbody Collider) |
Kinematic Rigid Body Collider (kinematic rigidbody Collider) |
Static trigger collision Body (Static Trigger Collider) |
Rigid Body Trigger Collider (rigidbody Trigger Collider) |
Kinematic rigid body triggering collision body (kinematic rigidbody Trigger Collider) |
Static colliding body (static Collider) |
|
Y |
|
|
|
|
Rigid Body Collider (Rigidbody Collider) |
Y |
Y |
Y |
|
|
|
Kinematic Rigid Body Collider (kinematic rigidbody Collider) |
|
Y |
|
|
|
|
Static trigger collision Body (Static Trigger Collider) |
|
|
|
|
|
|
Rigid Body Trigger Collider (rigidbody Trigger Collider) |
|
|
|
|
|
|
Kinematic rigid body triggering collision body (kinematic rigidbody Trigger Collider) |
|
|
|
|
|
|
Send trigger (Trigger) message during collision |
|
Static colliding body (static Collider) |
Rigid Body Collider (Rigidbody Collider) |
Kinematic Rigid Body Collider (kinematic rigidbody Collider) |
Static trigger collision Body (Static Trigger Collider) |
Rigid Body Trigger Collider (rigidbody Trigger Collider) |
Kinematic rigid body triggering collision body (kinematic rigidbody Trigger Collider) |
Static colliding body (static Collider) |
|
|
|
|
Y |
Y |
Rigid Body Collider (Rigidbody Collider) |
|
|
|
Y |
Y |
Y |
Kinematic Rigid Body Collider (kinematic rigidbody Collider) |
|
|
|
Y |
Y |
Y |
Static trigger collision Body (Static Trigger Collider) |
|
Y |
Y |
|
Y |
Y |
Rigid Body Trigger Collider (rigidbody Trigger Collider) |
Y |
Y |
Y |
Y |
Y |
Y |
Kinematic rigid body triggering collision body (kinematic rigidbody Trigger Collider) |
Y |
Y |
Y |
Y |
Y |
Y |
VI: Experimental table