I'm making an endless runner on Unity. There was a problem, how to make that when swiping up, the cube moved by 0.5 on the Z axis, and similarly, when swiping down, by -0.5 on the z axis.
P.S. that is, the cube has a position of 0, when swiping up, it moves to the coordinate 0.5, when swiping up again, it moves to the coordinate 1, etc.
I also attached a photo with my idea.