Simple movement script fail

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);
}

Might be a bug.

The values are updating, but Debug.Log isn’t reflecting it for some reason.

This seems to “unstick” it:

Debug.Log("V="+v+" H="+h +" at " + Time.time);

Or you could just view the changes via OnGUI.

Thank you tonyd :slight_smile: