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
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.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on AudioMixer::GetFMODChannelGroup when entering Play Mode in a specific project
- Prefabs with "Flags" enum properties result in "IndexOutOfRangeException" when trying to commit/revert
- The Camera first person mode in Cameras overlay is greyed out and not clickable when the Editor is restarted with the Game View focused
- Scene View doesn't select the Canvas when it's clicked with the View Tool
- Transform fields are impossible to edit when Inspector window is resized
Add comment