Grab and move object with gaze pointer oculus quest 2

I want to grab an object with gaze pointer in oculus quest 2. i dont want to grab it with controllers but with the gaze and control it with the movement of the head. can anybody help me?

Vector3 vHeadPosition = Camera.main.transform.position;
Vector3 vGazeDirection = Camera.main.transform.forward;
Physics.Raycast(vHeadPosition, vGazeDirection, out oHitInfo, 400.0f)

This should work with any platform as long as you have the main camera at the real head position.
This should work with Unity 2021.1.6f1 and the new XR system:

//to be used in start
UnityEngine.XR.InputDevice handRDevice = InputDevices.GetDeviceAtXRNode(XRNode.RightHand);
UnityEngine.XR.InputDevice handLDevice = InputDevices.GetDeviceAtXRNode(XRNode.LeftHand);
UnityEngine.XR.InputDevice headDevice = InputDevices.GetDeviceAtXRNode(XRNode.Head);

//to be used in update
bool posRSupported = headDevice.TryGetFeatureValue(UnityEngine.XR.CommonUsages.devicePosition, out Vector3 posR);
vHeadPosition = transform.TransformPoint(posR); //to world coords
bool rotRSupported = headDevice.TryGetFeatureValue(UnityEngine.XR.CommonUsages.deviceRotation, out Quaternion rotR);
vGazeDirection = rotR * Vector3.forward;
vGazeDirection = transform.TransformDirection(vGazeDirection);
//qRotation = Quaternion.LookRotation(vGazeDirection);