- Home /
Rigidbody.AddTorque/AddForce Question.
I know this probably seems like a stupid question, but in my code I have keys WASD set up to add force and torque forward, left, and right. But I have no idea what the name of the backwards command is. I tried -forward, backward, back, backwards, and a couple others. Help would be great =D
Answer by Chris D · Jul 06, 2011 at 05:49 PM
I was always under the impression that you could toss a '-' sign in front of Vector3.forward
but if that's not working for you, take a look at the docs for Vector3.
"forward" is the same as Vector3(0, 0, 1)
so backwards would be Vector3(0,0,-1)
.
So, it turns out putting the "-" worked, I just put it in the wrong place. Like you said, it has to go in front of the Vector3. Thanks again!
No worries. If the problem is fixed, please mark my answer as accepted (check box by the thumbs up/down) so others will know that you've found your solution.