I am making a space combat game, in which the player can press q and e to roll their ship. I did this by adding torque to the rigid body when the player press q or e. However, after they do so, they keep on rotating. How do i make the angular velocity slowly go back to zero?
I tried using angular drag, but that does not work.
public float TurnSpeed; public Rigidbody rb; float currentturn; Vector3 turn; float turnEnabler; bool iszero; public float dampener; // Update is called once per frame void Update() { rb.AddTorque(new Vector3(0, 0, turnEnabler)); if (Input.GetKey("e")) { turnEnabler -= TurnSpeed; } if (Input.GetKey("q")) { turnEnabler += TurnSpeed; } rb.angularDrag = dampener; } }