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
- Nested Canvases with the same Order in Layer ignore Z position for render order when sharing parent Canvas
- ShaderGraph Material subasset loses texture reference when reimporting all assets while using a scripted importer
- Values changed on a prefab are not retained when entering Play Mode
- Shadow Caster 2D shadows partially disappear in specific spots when used with Composite Collider 2D in the Game view
- Hierarchy and Library parts in UI Builder are inaccessible when UI Builder window is resized and these elements no longer fit in the window
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.