I’m currently working on a vehicle system for my game, and when you accelerate, the vehicle’s rigidbody adds a thrust force, but when you hit ‘S’ to brake, it stops inmediatly (I’m setting velocity and angularVelocity to zero)

I tried putting ‘Time.deltaTime’ to see if it would stop as time passed but it instantly stops the vehicle, and by the way this isn’t the classic W to drive forward and S to drive backwards, this thing I’m trying to do is to hit ‘W’ to increase speed either forward or backwards depending if ‘carReverse’ is true or false, and the S key is only to stop.

You could multiply the velocity and angularVelocity with a float between 0 and 1. By doing this, the vectors would slowly become smaller and smaller, until they get to a critical point, where you should set them to zero.

Note that if you want to use this method with Time.deltaTime to make it frame rate independent, the new float should be bigger than 1 to compensate Time.deltaTime, and the product should be around 0.95 - 1, or something like that.

This solution is easy to implement, however it is not realistic - it is for calculating friction and other things. You will slow down too fast at the beginning, and too slow at the end. You may want to use a velocity-independent mode of braking.

For example, you could try to decrease the length of the vector by a fixed value. You can achieve this by getting the current magnitude, normalizing the vector, then applying the decreased magnitude again.