I am currently loosing my mind about something that I thought would be super simple. I want to get the velocity vector (or position vector) of my Oculus Quest 2 controller so I can use it in my code. Currently I am trying to do this with XRNodeStates (Unity - Scripting API: XR.XRNodeState.TryGetVelocity). However I just can’t figure out a way how to make it work - I am a complete beginner sorry.
What would the code be for this? If you could help me out that would be great!
All the best,
It works for me. I found it there:
public class ControllerVelocity : MonoBehaviour
LeftControllerDevice = InputDevices.GetDeviceAtXRNode(XRNode.LeftHand);
RightControllerDevice = InputDevices.GetDeviceAtXRNode(XRNode.RightHand);
LeftControllerDevice.TryGetFeatureValue(CommonUsages.deviceVelocity, out LeftControllerVelocity);
RightControllerDevice.TryGetFeatureValue(CommonUsages.deviceVelocity, out RightControllerVelocity);