OnTriggerEnter Event

Just an observation. In 2019.3.0b10 (untested in others)
In the attached Project the only GameObject with IsTrigger toggled ON is the Sphere.
The TriggerTrap script is attached to all GameObjects in the Scene.
The Sphere reports a TriggerEnter collision with the Cube and the Plane
The Cube and Plane report a TriggerEnter collision with the Sphere
Note the output in the console.
The docs Unity - Manual: Colliders
say :

The scripting system can detect when collisions occur and initiate actions using the OnCollisionEnter function. However, you can also use the physics engine simply to detect when one collider enters the space of another without creating a collision. A collider configured as a Trigger (using the Is Trigger property) does not behave as a solid object and will simply allow other colliders to pass through. When a collider enters its space, a trigger will call the OnTriggerEnter function on the trigger object’s scripts
.
Screenshot - 1009745a8fd48109c145ae3eeee82c08 - Gyazo

The call seems to be being made on the function on the scripts on the ‘other’ objects.
Is this the expected behaviour. ?

using UnityEngine;

public class TriggerTrap : MonoBehaviour
{
    private void OnTriggerEnter(Collider other) {
        print($"{this.name} Collision_Trigger with {other.name}" );
    }
}

Regards,

5161553–511742–triggerTest3D1111.unitypackage (40.9 KB)

My ‘guess’ is that the trigger<->trigger collider issue which is “resolved” in 2019.3.0b10 MAY be causing this situation.

If both objects have scripts that have OnTriggerEnter, both will receive the event. This has been the behavior as far as I can tell since I started using Unity.

1 Like

Thank you.
Looks like the Unity documentation needs to be modified to match that.
Regards,