Detect swipe along 3d arrows

Hi!

How can I select one of them by swiping in the right direction. I don´t need a tested script. Just some ideas…

Thanks!!! :slight_smile:

[36909-arrow+example.png|36909]

Break the problem into two parts:

1 - Calculating swipe vector

Write a class that reads touch positions to calculate the swipe vector. Take the touch start and touch end positions, project them into worldspace, subtract start from end to get the swipe vector in worldspace.

2 - Selecting a direction based on input vector

Dot the input vector with each direction. Take the dot product closest to 1 as your resulting direction.