Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
FunKing's avatar
FunKing
Expert Protege
3 years ago

How can I get the velocity / speed of the Motion Controllers in Unreal (or how to detect a "shake")?

Hi there!
 
I'm currently working on a PC VR project using Unreal Engine, and I'm using the Quest 2 via (Air) Link. I want to implement a feature that detects when the user "shakes" a controller. Is there any built-in functionality in Unreal Engine to help me do that with minimal latency?
 
One approach I've considered is calculating the velocity and acceleration of the controllers based on their positions. However, there might be a slight delay in detecting a movement change since I would need to process a few frames.
 
I found two Blueprint nodes in Unreal related to this: SetXRTimedInputActionDelegate and GetControllerTransformforTime. The latter seems to provide linear velocity and acceleration, but to me the documentation is not clear and I have no idea how to use them...
 
Any suggestions are welcome.
 
Thanks!