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
- A memory leak occurs with massive terrain when camera position changes occur.
- No valid hits are returned when using RaycastCommand
- Camera is not overlooking the main Scene in Scene View in the HDRP Sample Template
- TextShadow properties are not applied when displayed in a custom MenuItem Window
- Memory leak occurs when focused on Player while using Direct3D12
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???