In the following script I am able to move around like normal but I would like to change animations based on which direction I am going. I tried tapping into the h and v variables but for some reason they only change for the first few iterations and then they suddenly hang at some values (either 1 or -1). What is going on here?
function Update ()
{
var v = Input.GetAxisRaw("Vertical");
var h = Input.GetAxisRaw("Horizontal");
transform.position.z += (v*speed);
transform.position.x += (h*speed);
Debug.Log("V="+v+" H="+h);
}