Forum Discussion
zSkeeter136
7 years agoHonored Guest
Wave Detection with Touch Controller
I am trying to create a Wave Gesture detection so when the player waves they can interact with a NPC. I know I should be checking the distance between two position. I tried doing multiple swipes but without having a button to press down and release it didn't work correctly. The problem with that is having the player press the button for each swipe seemed like a terrible design choice. Any help will be greatly appreciated.
1 Reply
Replies have been turned off for this discussion
- MikeFTrusteeThere is no stock gesture API so you'l have to implement this yourself. It sounds like you're on the right track though with your position check, so lets see what your code looks like now and maybe we can offer some help.
If you dont have anything to show yet, here's an extremely rough abstracted example of how you might approach this:
-Set two vectors, left extreme, right extreme
-Check position of the target controller in an update loop
-If target controller matches one extreme (or within a certain threshold of this vector) register that as Vector A = matched.
-If vector A == matched, and the same action is repeated for Vector B, then we now know that one wave motion has been completed and we can clear both "matched" states.
-Repeat this with an incremental counter for as many times as you deem a suitable wave gesture and you're done :)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device