- Home /
Question by
laapsaap · Mar 24, 2013 at 11:42 PM ·
inputcharactercontroller
How to get movementDirection using CharacterController but without input.GetAxis ?
Hi,
I have been trying for hours to find a good way get movementDirection using a CharacterController. The object has no input.GetAxis and I need a float for direction (mecanim).
I came this far;
characterVelocity = controller.velocity;
thisAnimator.SetFloat("Direction", Vector3.Cross(thisAnimator.rootRotation * Vector3.forward, Vector3(characterVelocity.x, 0, characterVelocity.z)).y);
But this is not working correctly.
Thank you.
Comment
Your answer
Follow this Question
Related Questions
Button Input not working? 2 Answers
How would I Trigger a Change in Inputs 2 Answers
When I press Control my character cant move? 1 Answer
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
Problem with input 1 Answer