Search Issue Tracker

Fixed in 5.5.0

Votes

0

Found in

5.3.4f1

Issue ID

786032

Regression

No

OnTriggerEnter2D is called instead of OnTriggerStay2D when Collider2D geometry properties are being modified

Physics2D

-

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

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.