So my game has the player character walking around along the x and z axis with a static camera. There is no jumping involved.
What I have so far (Unity Script) which moves the character in the direction the controls are pushed, and it works just fine.
function Update ()
{
//movement
var contr : CharacterController = GetComponent(CharacterController);
moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= moveSp;
contr.Move(moveDirection * Time.deltaTime);
What I don’t have working is if I push a control, I want the character to face that direction as well as move that way. I have tried a lot of things, and they all end up rotating the character instead of walking in that direction. And then of course if I push up the character walks in that direction instead of going up. I have a feeling that transform.Rotate isn’t the direction I should be taking.
I plan on adding some sort of rotation smoothing as well, however pointing me in the right direction would be a big help. Please forgive me for being a newb, I haven’t done any programming since I was a kid with a c64.