Slow Down RigidBody2D Object

Hello Everybody.

I need to validate what I did to slow down a single object that use a RigidBody2D. I looked for solution but I didn’t find. So i try something and it work but please can you tell me if it’s dangerous to do that.

Simply, to slow down my RigidBody2D object :
I set RigidBody2D.simulated properties to false one in two in FixedUpdate :

rigidBody2D.simulated = !rigidBody2D.simulated;

The result work very well, as example in our game DragoDino, we have jumper enemy and now when we slow down he seems to be in slow motion :), so.
But if it’s dangerous to use that way or if you have another way, don’t hesitate to say me please !

Thanks a lot for answer !

Pierre Proudhon

It’s far from the best way to just slow down a Rigidbody2D. It removes all attached collider entries from the Box2D broadphase along with their contacts. When you enable ‘simulated’ again, it adds all the collider entries back to the broadphase and recalculates their contacts.

Why don’t you just modify its Rigidbody2D.velocity directly or simply set Rigidbody2D.drag ?

1 Like