Hello, I’m trying to make a ship
this is some of the script i have
if(Input.GetKeyDown("w")){
rigidbody.AddForce(Vector3.back*force);
}
if(Input.GetKeyUp("w")){
rigidbody.AddForce(Vector3.back*Time.time*-force);
this instantly stops the ship in its path, instead of instantly stopping i need it too stop over time, kinda like an accelerator for a car, if you acell you go faster, if you don’t you gradually loose speed.
I tried playing around with Mathf.Clamp & failed, I’m still quite new to scripting.
Any help would be greatly appreciated!
Thanks for reading!