Hey guys. I've been working on this 3d sidescrollr and managed to get the character flipping properly based on which way hes moving, but the problem is that if he runs towards the left, he will face left, but run right. Any help here?
var walkSpeed = 30;
function Update () {
if(grounded) {
moveDirection = new Vector3(0,0,Input.GetAxis("Horizontal"));
transform.LookAt(transform.position + moveDirection);
if(isMoveable == true){
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= walkSpeed;
moveStatus = "idle";
}
if(moveDirection != Vector3.zero && isMoveable == true) {
animation.CrossFade("run",0.2);
isMoving = true;
} else {
isMoving = false;
animation.CrossFade("Take 001",0.2);
}
}