Controlling body inertia

I’m moving a body by applying linear velocity. It kind of works, but there’s too much inertia - the character is slow to accelerate, and takes too long to stop, even with friction set to 1 for both ground and character. What can I do to affect the inertia?

Are you looking for something like: https://playground.babylonjs.com/#P8NLQQ#11?

Added logic (if no keys are pressed, set x- and z-velocity to 0):

if (inputDirection.length() === 0) {
    vel.x = 0;
    vel.z = 0;
    playerPA.body.setLinearVelocity(vel)
}

cc @Cedric

What @regna said :slight_smile:

The playground you linked does some ramp up on linear velocity. Change the ramp (or remove it) to have immediate velocity reach.

2 Likes