Search Issue Tracker

By Design

Votes

0

Found in

5.6.3p4

2017.2.0a1

Issue ID

972372

Regression

Yes

Collision2D.contacts returns 0 for a gameObject, which is queued for destroying in the same frame

Physics2D

-

Reproduction steps:
1. Open the attached project "2DContactPointsDestroyBug.zip";
2. Open the Main Scene;
3. Enter a play mode;
4. Press "Run" buttons for each setup.

Expected results: Collision2D.contacts will return correct value for each setup as all of them have collisions;
Actual results: The 4th setup, where destroy is called before using Collision2D.contacts or Collision2D.GetContacts, fails to register correct contacts for the collision.

Workaround: Manually delay the Destroy call or get the contacts before calling destroy on the object, like in setups 1, 2 or 3.

Reproduced on: 2017.2.0a1, 2017.2.0p3, 2017.3.0b11, 2018.1.0a6.
Not reproduced: 2017.1 and lower.
Regression started: 2017.2.0a1.

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.