- Home /
Character Controller - Rotate toward direction
Greetings,
I'm developing my own character controller based on a rigidbody, due to the face that the integrated character controller doesn't suit my need.
At the moment, I change the velocity of the object based on what buttons are pressed(W,A,S,D). But I want my object to rotate toward the direction it's going (8 directions).
Perhaps, I could do this based on it's velocity? ie: It's going at Velocity.x = 0.5 and Velocity.z = 0.5, then it would assume a 45 degree position.
If anyone has better ideas, or a way to do this. It'd be awesome.
Thank You.
do you want the object to move along its forward direction only?
if that's the case just rotate torward the direction you want to go and move along your forward axis.
I already thought of that, but it's not the type neither the feeling of control we want.
We want the direction of each Input to be static to the world environment. The directions in my code already works, but I need the rotation of the object to follow these directions.
Answer by milali · Dec 08, 2011 at 03:56 AM
ah use rotatetowards then? and then get a quat value and slurp to it over time?