I'm working on a nonogram game and I want to detect if the user is swiping on horizontal or vertical and lock his touch to that direction. Something like in Photoshop when you draw a line and you hold "Shift"key.
Develop games in your browser. Powerful, performant & highly capable.
You can use Touch.SpeedAt, Touch.SpeedForID expressions to detect swipes, and Touch.AngleAt or Touch.AngleForID expressions to get swipe angle. Then use a condition like "Is between angles" or "Is within angle" to check if the swipe is closer to horizontal or vertical line.
Another way is to save Touch.x,Touch.y on touch start in a pair of variables, and then on every tick compare the angle from touch start coordinates to current touch position.