Something weird is going on here. Basically, I’m running a script that changes a variable according to the value returned by Input.GetAxis. Nothing new, really. The problem is that the change in Input.GetAxis’s value seems to lag. It takes a fraction of a second for it to catch up with the rest of the game. Here’s my code:
var moveDirection = 0;
var move2 = 0 //for comparison
function Update()
{
moveDirection = Input.GetAxis("Horizontal");
if (GetKeyDown("left"))
{
move2 = -1
}
if (GetKeyDown("right"))
{
move2 = 1
}
}
Shouldn’t moveDirection and move2 be changing values at the same time? Why isn’t this the case?