Is HMD connected

hello everyone, I have a problem with some commands to HMD (Oculus Rift).
I was looking for a way to know if the device is connected or not, and the only thing I’ve found is “Is Head Mounted Display Enable?” which unfortunately lets me know if it is enabled and not if it is connected.
Is there a blueprint command like “Is HMD connected”?

Hi!

You should use “Enable HMD” node. This node return True, if your request was saccesful.

thanks for the reply but with “ENABLE HMD” I can decide whether or not to enable the device. I would need to know when the device is attached to the computer and when not. I hope there is such a function

I’ll preface this by saying this is a C++ solution as I was unable to find a blueprint solution myself, but I coded the following into my own blueprint library for use as a BP node.

Someone else should double check this, but I was looking through the source and just implemented this code into my project. Unfortunately, my coworker has the Oculus right now so I can’t do any testing.

if (GEngine && GEngine->HMDDevice->IsHMDConnected()) { //stuff }

To get the device type, I’m using:

EHMDDeviceType::Type result = GEngine->HMDDevice.Get()->GetHMDDeviceType();

This returns a EHMDDeviceType value based on the specific device that is connected.

Hope that helps for now.

Cameron

Have you tried typing “Is Head Mounted Display Enabled”?

I just tested and both of these solutions (svv3dUDN’s and ZeJudge’s) seem to work. Both return “false” even when I have an HTC Vive plugged in to my computer but am not actively using it in Unreal.

(NOTE: Some other proposed solutions, like ‘get HMD device type,’ DIDN’T work for me… those seemed to detect Steam VR even when I wasn’t using the Play-in-Headset playback option.)

In case it helps further illustrate, here’s a quick macro I made using these nodes to switch camera control from pawn to HMD when an HMD is enabled: