I am trying to set my character up to strafe left and right and have 2 different animations, on for left and one for right, so far what i have written allows me to strafe left or right but it only ever plays the right strafe animation. What am i doing wrong?
private void Strafe() {
if (Mathf.Abs (Input.GetAxis ("Strafe")) > 0) {
animation.CrossFade ("strafeRight");
_controller.SimpleMove(_myTransform.TransformDirection(Vector3.right) * Input.GetAxis ("Strafe") * strafeSpeed);
} else if (Mathf.Abs (Input.GetAxis ("Strafe")) < 0) {
animation.CrossFade ("strafeLeft");
_controller.SimpleMove(_myTransform.TransformDirection(Vector3.right) * Input.GetAxis ("Strafe") * strafeSpeed);
}
}