Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.3.4f1
2019.4
2020.2
2021.1
2021.2
Issue ID
1284428
Regression
No
OnTriggerEnter and OnTriggerExit triggers get called when interacting with the Editor
How to reproduce:
1. Open tester-attached project (UI_TriggerState.zip)
2. Open the DoorTest scene
3. Enter Play Mode
4. Press Space to open the door
5. Note the OnTriggerEnter and OnTriggerExit GUI output
6. In the Hierarchy window select 'TriggerTest' GameObject, open and close its Rigidbody's Collision Detection dropdown
Expected result: OnTriggerEnter and OnTriggerExit GUI output does not change
Actual result: OnTriggerEnter and OnTriggerExit GUI output logs additional calls
Reproducible with: 2018.4.31f1, 2019.4.20f1, 2020.2.3f1, 2021.1.0b5, 2021.2.0a4
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note:
User is setting rigidbody position and rotation on Update(). At the very least this should only be done in FixedUpdate() unless there's a good reason to do otherwise. Also the Enter/Exit trigger calls happen not just when the Collision Detection dropdown is selected, but on a general UI update.
Because of how the project is setup, I believe under the hood the object is being moved around in-between physics updates and PhysX interprets that as the collider leaving and re-entering the trigger zone.