Physical Event

    Collider property IsTrigger determines whether the component is a trigger or a collider. When IsTrigger is set to , the component is a trigger. Triggers are only used for collision detection and triggering events, and are ignored by the physics engine. With false set by default, the component is a collider and can be combined with to produce collision effects.

    The difference between the two is as follows.

    • Triggers do not do more detailed detection with other triggers or colliders.
    • Colliders will do finer detection with colliders and will generate collision data such as collision points, normals, etc.

    Trigger events

    Trigger events currently include the following three types:

    The collision pairs that can generate trigger events are

    Collision events are generated based on collision data, and no collision data is generated between rigid bodies of static types.

    Currently collision events include the following three types:

    Where the collision pairs that can generate collision events are

    Listening to Collision Events

    Difference between Trigger Events and Collision Events

    • Trigger events are generated by triggers, collision events are generated based on collision data.
    • Collision events need to be generated by two colliders, and at least one of them is a dynamic rigid body.

    Compared to the continuous real world, the physics engine simulation is actually discrete, which means that the physics engine takes 1/60th of a second or some other defined time to sample once. Therefore, for faster objects, the physics engine may not be able to detect the collision results correctly, to solve this phenomenon, you can turn on continuous physics detection (CCD).

    Turn on continuous collision detection in the engine as follows:

    Refer to Continuous Collision Detection for a more detailed description.

    Event Trigger Rules

    The generation of collision events will vary depending on the type of rigid body, collider or trigger, the results are organized here as shown below.