- Home /
Question by
potatongravy1 · Jul 17, 2015 at 12:49 PM ·
rotationphysicsvelocityrelative
Velocity Relative to Rotation
Hi,
I am wanting to change an objects velocity relative to the y rotation. For example, when you change the velocity to go forward, the object will still move forward in it its local forward direction, rather than the world one.
Any help would be greatly appreciated.
Cheers, Bradley.
Comment
Answer by _dns_ · Jul 17, 2015 at 02:35 PM
Hi, using yourobject.transform.forward in an AddForce during FixedUpdate should do what you want (or directly adding this vector to the velocity).
transform.forward (or.left etc...) is the local forward vector transformed in world space.
I managed to get it working using a similar method to what you suggested. Cheers for the help though :)