Separate visual contact from trigger delivery
OnTriggerEnter is a method Unity calls when one collision shape (Collider) enters another trigger shape. This guide targets Unity 2022.3 LTS 3D physics. Visible meshes can overlap while their Colliders remain apart. Put a log before checks such as tags to see whether OnTriggerEnter is called at all.
1. Check the collider/body pair
Both objects need active 3D colliders. Enable Is Trigger on at least one, and associate at least one side of the pair with a Rigidbody. Both sides do not need bodies; a kinematic Rigidbody also supports trigger messages. A pair consisting only of static colliders without bodies cannot generate them.
The diagram shows one example: a static trigger zone and a moving collider with a Rigidbody. A child collider can belong to a parent body; inspect Collider.attachedRigidbody. Testing two colliders belonging to the same body is not a substitute for testing an interaction between separate bodies.
2. Check layers and ignored pairs
Open Edit → Project Settings → Physics and inspect the Layer Collision Matrix for the actual collider GameObjects. A child collider can use a different Layer from its parent. Tags used by gameplay filters are separate from physics Layers.
Trace Physics.IgnoreCollision and IgnoreLayerCollision calls, including initialization and pool reuse. They can exclude a pair even when both colliders are enabled. Isolate the two colliders before changing unrelated Layer rules.
3. Put a probe on the receiver
Save the following diagnostic code as TriggerProbe.cs and attach it to the same GameObject as the trigger collider. An arbitrary ancestor does not automatically receive the callback. Temporarily remove gameplay filters and check the Console filters.
using UnityEngine;
public sealed class TriggerProbe : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
Debug.Log($"Trigger entered: {other.name}", this);
}
}
The 3D argument is Collider. Collider2D and Rigidbody2D belong to a separate system and use OnTriggerEnter2D(Collider2D other). Mixing 2D and 3D components does not satisfy the 3D callback requirements.
4. Test a slow entry during simulation
Use a simple Box and Sphere in a reproduction scene. Inspect the moving body's movement code and make its collider enter the zone slowly from outside. Teleporting across a thin zone introduces a separate detection problem.
Check active GameObjects, enabled colliders and Rigidbody.detectCollisions. Events are processed during physics simulation, so do not expect synchronous delivery immediately after assigning a position. When paused or using manual simulation, verify that physics steps actually advance.
Verify the correction
- Confirm the unconditional log on a slow outside-to-inside movement.
Inspect collider overlap, layers and the receiver - Restore Layer rules and gameplay filters individually.
Inspect collider overlap, layers and the receiver - Check child colliders, multiple colliders, pool reuse and the target device.
Inspect collider overlap, layers and the receiver - Investigate multiple notifications from multiple colliders; manage one-time gameplay work per intended target.
Inspect collider overlap, layers and the receiver
OnTriggerEnter reports entry. Distinguish ongoing overlap logic such as OnTriggerStay. See the tunneling guide for fast movement.
References
- OnTriggerEnter: callbacks and physics simulation
- Introduction to collision: trigger requirements
- Interaction between collider types
- Layer-based collision detection
- Physics.IgnoreCollision
- Physics.IgnoreLayerCollision
- Collider.attachedRigidbody: parent body association
- Rigidbody.detectCollisions
- OnTriggerEnter2D: separate 2D callback