Thanks for the great library.
I'm trying to prevent my bodies to rotate. It would be a "unary" constraint. I've looked at the code and issues but it looks like it's not possible currently. If not, I'd be happy to submit a PR if you can put me on the right track!
Try set inertia to Infinity when you create your body.
Awesome! Thanks a lot.
Does that still work? I tried setting my player object's inertia property to Infinity and it still tips over. I tried both:
player.body.inertia = 'Infinity';
And
player.inertia = 'Infinity';
The object still tips over. Note this is with a Phaser JS app using the Matter JS physics engine.
@roschler it needs to be the word Infinity without any quotes as it's a value in JS, then it should work.
@roschler you can use setFixedRotation func
player.setFixedRotation();
Most helpful comment
Try set
inertiatoInfinitywhen you create your body.