Latest 5.2.2p3 Patch Breaks 2D Collision?

I just updated to the latest patch 5.2.2p3 and now hardly any 2D colliders are triggering. I would say only about 10% off OnCollisionEnter2D events are triggering.

The collision is happening – as the physics engine is still bouncing the objects off of each other – but the event OnCollisionEnter2D is no longer firing.

I’ve not made any code changes – just installed the latest patch and try to run my game in the Editor.

This happening for anyone else?

Manny

I’ve already acknowledged this issue several times on forums and once on twitter and this is the first I’ve seen this thread so please be patient. Posting on forums is much more likely to get a response than here which is harder to track.

This issue was fixed a while ago and has been ready in the latest patch waiting for release in 5.2.3p1 that is, I believe, due out for release today (25th Nov 2015).

The problem is with collision-reporting when a Rigidbody2D using continuous collision detection, both enters and completely exits a contact during a single physics update.

Sorry for the problem but a fix was issued on the same day it was reported. It’s just that there’s a week or so delay before a patch gets out.

Same here - I get the collision callbacks if the objects collide at a very slow velocity.

Looking at the patch notes, it’s possibly this:

(719418) - Physics: Physics2D, Collider2D & Rigidbody2D IsTouching and IsTouchingLayers now correctly represents Box2D contact state.

If I was to guess, I’d say the collision callbacks are only being called if your objects happen to be touching on the frame itself (hence why it works when the objects have a low velocity), so if there’s a collision between frames, they’re not triggered

Update: Just updated to patch 5.2.2p4 – STILL BROKEN.

Still present in 5.2.3f1. Please upvote the issue here: http://issuetracker.unity3d.com/issues/continuouscollisiondetection-if-multiple-collisions-happen-in-one-update-oncollisionenter2d-is-only-called-for-the-last-one

Same here… Any idea how to fix it?

UPDATE: I found a workaround: Add a “Rigidbody2D” component to your object and set it as “is Kinematic”… done!

UPDATE 2:
To clarify: prior to the problem I did not have a Rigidbody2D attached to the object, when I add it, it solves the problem (the fact that it is Kinematic or not, is irrelevant to the collision). Something I’ve noticed is that you use “OnCollisionEnter2D”… and in my case I use “OnTriggerEnter2D”

I am having the same issue… just upgraded from 5.1 to 5.2.2p4.
Was going to try 5.2.3 but as mentioned above by @densy07 looks like it’s not fixed in that.

I have two objects, both with RigidBody2D and colliders.
One is set to kinematic and discrete collisions.
The other is not kinematic but has continuous collisions.

This worked perfectly in 5.1.
Now I am finding that OnCollisionEnter2D is called 90% of the time.
The times it is not called, the two objects are moving past each other quickly, they bounce off each other but the event is not fired.

The problem is fixed if I change the object with continuous collisions to discrete collisions. However that causes problems with the accuracy of other collisions in our game so not a solution for us.

Hopefully this will be fixed in the next patch :frowning:

I just had the exact same issue. Upgraded from 5.1 to 5.2 and all of a sudden my collisions/triggers weren’t firing. For me I fixed it by changing my one RigidBody2D sleeping mode to “Never Sleep” (it was “Start Awake” before). That resolved it for me. Not sure if that helps your issue but maybe it will.

We got the same issue. It’s crazy that this is happening and even crazier that Unity doesn’t acknowledge it. Collisions should always work.

Strange thing. I first encountered that issue after the update from 5.2.2 to 5.2.3f1
Does it increase the performance overhead by adding a rigidbody to the collider/trigger?
I have hunreds of GameObjects in the scene whicht recieve trigger information. Im concerned that by adding a rigidbody to each of them it may cause performance issues.

Fixed and ReBroken in 5.2.3p1…

OnCollisionEnter2D now fires correctly under medium to high velocity…
OnCollisionEnter2D no longer fires correctly under low velocity, regardless of the Physics2D settings
OnTriggerEnter2D no longer fires correctly under at any velocity, it works one out of 100 times.

Mind you my application works perfectly under 5.2.2p1, but every patch since then the physics have been broken. I have frozen development on this application until this issue is resolved. Unfortunately, issues like this should never go unchecked for such a long duration on such a critical component.

Hey guys, my collision was broken completely in 5.2.3 and 5.3. After some playing around I found that switching the sleep mode of the rigid body of the colliding objects from ‘start awake’ to ‘never sleep’ fixed the issue. It will have to do for now. Hope it helps with your problems too.