Search Issue Tracker
Fixed in 5.5.0
OnTriggerEnter2D is called instead of OnTriggerStay2D when Collider2D geometry properties are being modified
How to reproduce:
1. Open the attached project
2. Open and play Example scene
3. In the Scene view, select Trigger2 (red). Trigger2 contains a kinematic box trigger set to 'Never Sleep'.
4. Drag Trigger2 over Trigger1 and note that Trigger1 changes to blue, indicating OnTriggerStay() is received. Flickering between gray and blue is expected because OnTriggerStay2D() is not called every frame.
5. In the Inspector, use the mouse to drag the box collider's size and offset x/y values in Trigger2 while observing Trigger1.
Actual: Trigger1 will be green for most frames, indicating continuous reception of OnTriggerEnter2D(). Occaisional flickering of gray and blue occurs.
Expected: Trigger1 will be blue for most frames, indicating continuous reception of OnTriggerStay2D().
Note: One can enable "Play Automatically" in Trigger2's Animation component and repeat step 4. Animating collider causes the same issue- OnTriggerEnter2D is called instead of OnTriggerStay2D
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [TestRunner] NUnit tests doesn't time out when [Timeout()] attribute is set
- When "draw instanced" is changed for entire terrain group and then undone, it is only undone for the terrain that was selected
- Custom Inspectors OnDisable still called after Asset has been deleted
- [Build Pipeline, Meshes] Mesh Optimization is not using enabled Material Keywords
- [UWP][MR] Development console is in incorrect position in Window Mixed Reality app