Disabling velocity from "First Person Controller"

As the title says, how can we stop the acceleration ?
I want that the controller stops and starts when I press the key.
How do we remove the acceleration either at stop or start ?

I have seen this threads :

But I think they are all old, and are not applied anymore.

Thanks !
Bruno

if (Mathf.Abs(Input.GetAxis("Vertical") > 0.01f)) {
    V=1.0f;
} else if (Mathf.Abs(Input.GetAxis("Vertical") < 0.01f)) {
     V = 0f; 
     if (gameObject.GetComponent<Rigidbody>()) {
          gameObject.GetComponent<Rigidbody>().velocity = Vector3.zero;
     }
}

I believe this will also disable gravity. Also, if this is running in Update, this will fail to provide desired effect due to physics using different framerate.

Gravity or localGravity can be applied after the vertical component which is usually applied to forward motion in this type of case… He was looking to go from 0 to whatever in one frame flat. It also zeroes out the rigidbody when at rest as defined by the scope of the problem he wished to resolve… Inputs are gathered in Update. physics carried out in FixedUpdate using variables gathered from the Input in Update. I was not going to write the whole script…just give him a clue. Done this dozens of times for all kinds of rigidbody character and PID controllers.

Use Input.GetAxisRaw instead of Input.GetAxis

or set up getaxis so there’s no inertia (there is inertia added to the controls in input manager by default - which is a dumb decision).

Checked it out.

There’s no code for inertia in either first person controller. What you see as inertia is smoothing added by Input manager.

So, either use GetAxisRaw (Just edit FPSController’s script and replace “GetAxis” with “GetAxisRaw”) or configure the input axis to have less smoothing.

In case of Rigidbody first person controller, even if you use input values without smoothing, there will be some inertia left, but it’ll be nothing like what you get by default.