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,