Search Issue Tracker
By Design
Votes
8
Found in
5.0.1f1
Issue ID
691389
Regression
No
OnCollisionEnter2D is not called on every collision
Steps to reproduce:
1. Open attached project's scene "scene".
2. Open Listener script, in OnCollisionEnter2D include Debug.Log("Collided"), in OnTriggerEnter2D include Debug.Log("Triggered").
3. Play the scene.
4. Count of number of triggers is around 2-3 times higher then number of collisions.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Usage of Adaptive Probe Volumes throws a lot of IndexOutOfRangeException and Assertion Failed errors
- Prefab overrides don't recover missing managed references
- Trail Renderer visual doesn't match the positions of vertices when they have been offset
- [Mobile] The Material is not visible when using the Decal Renderer Feature
- Uncaught TypeError: Cannot read properties of undefined is thrown when the tab is inactive for several minutes
Ruskul
Apr 27, 2015 20:54
It isn't just "OnCollisionEnter2D" that is broken. To see this, try throwing a test script onto and object ("ObjA") that has print outs for all the trigger and collision methods. Create an Obj B. Add colliders to both objects.
If you test every match up (static, dynamic, kinematic) you can see how only a dynamic object interacting with a static object accurately reports all Enter/Exit/Stay. Trigger2Ds also report badly in the same ways.
I have used box2d extensively in other projects. It's not that hard to implement. Freeware game engines (love, for example) don't have problems of this magnitude. Even game engines like construct 2 don't have blaring bugs in their physics like this (and when they do I can edit the source). This bug is inexcusable and I would be ashamed for shipping the 2d physics in the state that it is in. Did nobody run unit tests, or am I just missing something???