Page 1 of 1

Menace of the Infinitely Spinning Box2D Polygon

Posted: Tue Oct 16, 2018 12:46 am
by Gold_Car
Previously I made a game about a jointed Box2D object due to my limitations as a developer at the time, and that player character had a system of control that turned out to be something of a darkhorse, so I'm using Box2D in this indirect sequel too.

The only problem is, something weird can happen whenever you control this character for long enough. Eventually, once you've spun around enough, the character can start snowballing and spin faster and faster until it's practically a strobe, even when no buttons are being held down. It's actually kinda hilarious. But needless to say, you should not play this love file if you have epilepsy.

Currently this game is in the early character testing phase so I can get controls polished and comfy like they were in my other Box2D game, but I can't get any further until this bug that makes it spin like utter insanity is dealt with, and I've tried almost everything to make it go away.

Do you know what might be causing this? Testing file enclosed.
test_share.love
(1.99 MiB) Downloaded 20 times

Re: Menace of the Infinitely Spinning Box2D Polygon

Posted: Tue Oct 16, 2018 2:50 am
by pgimeno
I think that the problem is that you're creating weld joints of interpenetrating bodies. It's not the first time I see such a system go crazy.

Try creating a single body with multiple shapes/fixtures instead.