- Home /
Addforce in local space?
hey, how do you change a addforce from global to local? heres what i have at the moment
this.rigidbody.AddForce(0,-1000,0);
Instead of it going straight down i'd like it to go along its -z axis. :)
While I'm sure you figured this out I do want to add something to help others incase they mistaken a issue with what you tried the code you used way in the Y not the Zed this comment is for future people looking for assistance
// adds global force on any axis you want
Rigidbody.AddForce(new Vector3(x,y,z));
//adds force along the local axis
Rigidbody.AddRelitiveForce(new Vector3(x,y,z));
Answer by Eric5h5 · Dec 22, 2010 at 04:49 AM
Use AddRelativeForce instead of AddForce.
Really thanks, I'm a beginner and wouldn't have find this without your help
Answer by Tsurugi21 · Mar 10, 2013 at 05:22 PM
Searched for hours to get an answer this easy -_- Thanks!
Same thing here... was messing around for a couple of days and didn't even think about that...