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
- Mouse input is registered incorrectly in Custom RP when downscaling Render Target and rendering Overlay UI before final upscale
- Time.deltaTime is locked to the display's refresh rate when the built Player is moved to a Secondary Display and Windowed Mode is used
- Crash on RaiseException when importing a specific asset
- Crash on RaiseException when opening a specific project
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
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.