I tried my first game with a character moving upwards on a Screen constantly (top-down view on a Road). Now I wanted to change the character animation to a strafe based on his movement to the left or right.
Problem is: the only available input is touch. So the player is dragged left or right (and a bit up and down) to avoid random obstacles.
Is there any way to determine if a player is dragged to one side more then lets say 10 Pixel? I could not figure it out.
Depending on how you change the position, there may be different possibilities. Are you using the behavior of ai and forces, ii just changing position?
@E1e5en Just the behaviour “draggable” on the object.
@MrMen That’s promising, but how can it be achieved? The player is dragged constantly around, so I cannot use “is being dragged” as trigger. So if the Player is dragged from x=300 to let’s say X=500 and then - without being released - dragged back to X=400 I would have to get the direction change at x=500 to change the animation from left to right.