This is probably the most random problem I’ve ever had, but here goes nothin’. I’m making a game about Sgid (don’t ask) and I wrote a script to make him float around. The script looks like this:
function Update () {
if (Input.GetButton("right")) {
transform.Rotate (0, 8, 0);
}
if (Input.GetButton("left")) {
transform.Rotate (0, -8, 0);
}
if (Input.GetButton("up")) {
rigidbody.AddRelativeForce (Vector3.forward * 15);
}
if (Input.GetButton("down")) {
rigidbody.AddRelativeForce (Vector3.back * 15);
}
if (Input.GetButton("FloatUp")) {
rigidbody.AddRelativeForce (Vector3.up * 15);
}
if (Input.GetButton("FloatDown")) {
rigidbody.AddRelativeForce (Vector3.down * 15);
}
}
But when I press the button for FloatUp he floats up while rotating counter-clockwise. Why is he rotating?