- Home /
capture user frame input getaxisraw
So Im trying to capture a users input and Im storing it in an array but i noticed that one tap is like 3 inputs if (movey == -1f) { Debug.Log(movey);
CaptureIput("down");
}
else if (movey == 1f)
{
Debug.Log(movey);
CaptureIput("up");
}
if (movex == -1f)
{
Debug.Log(movex);
CaptureIput("left");
}
else if (movex == 1f)
{
Debug.Log(movex);
CaptureIput("right");
}
}
capture code:
void CaptureIput(string direction)
{
for(int i = 0; i<input.Length;i++)
{
if(input[i] == null)
{
input[i] = direction;
break;
}
so what I think I found out is that it gets every frame that you press the button not the initial input so my question is how do you capture the first frame that the user pressed the button so I can capture one input
Comment