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.
Comments (1)
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
- Blank, Light-Themed "Create Node" window becomes visible on the next project open
- UI Elements/Layout inconsistencies in the Particle System component
- The Game view and Scene view fail to render when launching the Editor with a maximized Render Graph Viewer window
- "List is empty" is poorly visible in the "Create Node" window
- [Android] GameObject with a custom shader becomes invisible when deployed with the Vulkan Graphics API
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???