Major Bug : Position Constrained RigidBody2Ds snap to origin.

I initially discovered this problem in 5.1.1 and submitted a bug, but it’s still sitting open and hasn’t received any response and it’s still happening in 5.1.2. This is a problem on multiple projects we are working on right now.

It’s a simple problem to demonstrate. Rigidbody2Ds with freeze position X constraints will randomly snap to the origin and become unmovable. They cannot be dragged from their position with the move tool while running, and if you pause and move them they will immediately snap back when play resumes. Any other rigidbody2d who’s collider contacts the stuck rigidbody becomes stuck as well.

This was submitted on 7/8/2015 as Case 710667, but I didn’t mention it on the forums because I figured something this significant would have been noticed already. I’m now bringing it up since it doesn’t seem to have been addressed and is still happening in 5.1.2

Bump / Ping @MelvMay

Any chance you could take a look at the Case 710667 related to this?

I made a video to demonstrate the part of the bug.

It’s really a major bug, it’s completely game breaker. I spent nearly a week, to figure out the problem. Now one of my major features have to be leaved off, because there is no solution for this right now. Please, do something about it.

Yeah. That’s exactly what I’m seeing. It’s affecting two projects my team is working on right now.

Yes, the problem is being looked at. We’ve had several bug reports about this issue. All of them appear to happen only under OSX where NaNs/Infinities are returned from Box2D for the position of the rigid-body. When a NaN/Infinities is seen for position, corrective action is taken and the position is reset to zero.

As to WHY Box2D is returning NaN/Infinities for position, we don’t know yet but it’s most certainly related to the joint used for constraints.

All reports are useful: Do you have a simple reproduction case handy you can post?

So, a joint is being used for constraints even if the Rigidbody2d doesn’t have a joint attached?

Yes, there’s no other way to constrain bodies in Box2D.

You may be pleased to hear that I have just isolated and fixed the issue. I am now producing a build on our build-farm to get this confirmed by QA. I’ll update you when I know more.

Super awesome! Thanks!

I knew you were the right person to ask!

It was happening on my teammates Windows machine as well…

It passed the provisional QA and is currently being reviewed, then on its way to the patch system.

Sorry this took so long to get fixed.

1 Like

The fix has landed in 5.1.2p3 which, if all goes well, is due for release on 5th August. QA have verified that it fixes all known reports so hopefully it’ll solve your cases as well.