Download

"Get Motion Controller Data" not working

Hello!

I’m having trouble with the “Get Motion Controller Data” function (both in Blueprint and in C++).
They always return “Not Tracking” for both hands (and zero as their position), even though the controllers are clearly working as I can see them in he scene, move them around, and can get the location and rotation of the MotionController Components.
I can even use “Enumerate Tracked Devices” with the device type set to “Controller” and it will return the two controller IDs.

Even weirder, in another project on the same machine that was derived from the UE VR template the “Get Motion Controller Data” function works, so I know it’s not a problem with the VR gear or software.

So there must be some hidden setting or initialization step that I’m missing that the UE VR template does to make the “Get Motion Controller Data” function work, but I just can’t find any (relevant) differences between the projects.

Any ideas would be appreciated.
Thank you!

Hey!

The VR Template in 4.27 has OculusVR and SteamVR disabled. The “GetMotionControllerData”-function is designed for OpenXR, and doesn’t work as intended when you’re using Steam and/or Oculus.

Try disabling OculusVR and SteamVR plugins, and enable OculusOpenXR if you’re using an Oculus device in your custom projects!

1 Like

Thank you for the explanation!
I forgot to mention that I’m on 4.26.
It’s weird because when I checked the Template Project, it had the same plug-ins activated as the “broken” project (Oculus VR and Steam VR),
but when I switched the plug-ins on the “broken” project to OpenXR as you said, the function started working.
Any idea how the Template might pick the right template if not through the “.uproject” file?
Thanks again!

Ah, the VR Template in 4.26 doesn’t use GetMotionControllerData so I assumed you were on 4.27.

Either way, GetMotionControllerData would function the same way in 4.26 as in 4.27 with regards to which plugin is able to return the correct data for it.

Sorry I don’t understand this question.

Sorry, I formulated the question badly.
What I meant was:
If I look at the Plugin Manager, both the “template-based” project and the “from-scratch” project had the same plug-ins enabled (OculusVR and SteamVR).
In the template-based project GetMotionControllerData was working.
In the from-scratch project GetMotionControllerData was not working.
But once I changed the plug-ins in the from-scratch project, it started working there as well.
So I thought the template-based project has some other way of selecting the plug-in, without using the Plugin Manager or .uproject file, but does it?

Thanks again so much for your help!

No, but the reason why you saw it working is because it sometimes resolves incorrectly and returns data that makes it seem like it work - since we’re moving towards OpenXR fixing the function for OculusVR and SteamVR plugins was de-prioritized over more pressing matters.

I understand. Thank you again so much!

1 Like