- Home /
How to get local axis from characterController.velocity
I have an fps character that is not a rigid body. With the normal characterController.velocity you get the global velocity, i'm trying to get the local velocity (the x, y and z of the character game object) so that I can get a "forward", "side" and "up" velocity. Is this possible and how?
the character.velocity i mean is: http://docs.unity3d.com/Documentation/ScriptReference/CharacterController-velocity.html
Thanks a lot!
Answer by robertbu · Jul 24, 2013 at 05:42 PM
Not sure what you are asking for. CharacterControler.velocity is not a global/world velocity. As the comments in the reference states, if the character is a child, this only captures the movement of the CC not the World velocity. But what I think you are asking about can be handled by Transform.InverseTransformDirection().
Yes! Not what i was expecting but perfect anyway. Thanks :)
If your question is answered, click on the checkmark next to the answer to close it out. Thanks.