Gameobject consistently rotates to the right when applying force along transform.forward
So I have been making a basic car script, that allows the user to drive round and turn, when I noticed that every single time, the turning angle when going right was much sharper than when turning left. I messed around with the code for ages, with no resolve.
So to test if the fault was really my own code, I made a simple cuboid, and applied a force in the direction of transform.forward. Sure enough, every single time the cuboid begins to rotate on the y axis to the right as it moves forward. Here's a copy of the code on the cuboid:
Rigidbody rb; //The rigidbody of the cuboid
// Use this for initialization
void Start () {
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update () {
if (Input.GetAxisRaw("Vertical") != 0)
{
rb.AddForce(transform.forward * 40 * Input.GetAxisRaw("Vertical"));
}
}
Every single time I apply this force, the gameobject rotates consistently to the right hand side. What I expected was the y rotation to remain 0, or at least be a very slight change either way, not a consistent positive rotation.
Is there any way to stop this rotation?