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
- [URP][Lighting] The skybox doesn't render after changing the settings of the Material when using the URP Render Pipeline
- Crash on ShaderLab::ShaderState::ApplyShaderState when entering Play Mode and calling ShaderWarmup.WarmupShaderFromCollection with a shader that has dynamic_branch
- Crash on operator delete[] when a serializable structure in the System namespace is serialized by a MonoBehaviour
- [macOS] forward and backward mouse buttons are recognized as middle mouse button
- NavMeshModifier.OnEnable/OnDisable gets progressively slower when called repeatedly
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.