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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Add comment