# Auto-detect the type of HMD?

**URL:** <https://forums.unrealengine.com/t/auto-detect-the-type-of-hmd/36271>\
**Category:** XR Development\
**Tags:** unreal-engine\
**Created:** [July 23, 2015, 8:28am UTC](https://forums.unrealengine.com/t/auto-detect-the-type-of-hmd/36271 "2015-07-23T08:28:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoadStar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RoadStar](https://forums.unrealengine.com/u/RoadStar)\
**Post date:** [July 23, 2015, 8:28am UTC](https://forums.unrealengine.com/t/auto-detect-the-type-of-hmd/36271/1 "2015-07-23T08:28:15Z")

</div>

Hi!

Can you advise me please the robust way of HMD type detection (if exists)?

For example, I would know, does Oculus or SteamVR (HTC) is active on start…

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Opamp77](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Opamp77](https://forums.unrealengine.com/u/Opamp77)\
**Post date:** [July 23, 2015, 11:11am UTC](https://forums.unrealengine.com/t/auto-detect-the-type-of-hmd/36271/2 "2015-07-23T11:11:07Z")

</div>

GetHMDDeviceType(); returns an EHMDDeviceType Enum;

Example,

```auto

if ( GEngine->HMDDevice.IsValid() ) //check pointer is valid
{		
	uint8 result = (uint8)GEngine->HMDDevice->GetHMDDeviceType();
	if ( result == (uint8)EHMDDeviceType::DT_OculusRift ) UE_LOG(LogTemp, Warning, TEXT("Device is Rift"));
	else if ( result == (uint8)EHMDDeviceType::DT_Morpheus ) UE_LOG(LogTemp, Warning, TEXT("Device is Morpheus"));
	else UE_LOG(LogTemp, Warning, TEXT("Device is Other"));
}
else UE_LOG(LogTemp, Error, TEXT("No device found!"));

```

---

<div class="post-metadata">

**Author:** ![RoadStar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RoadStar](https://forums.unrealengine.com/u/RoadStar)\
**Post date:** [July 23, 2015, 3:49pm UTC](https://forums.unrealengine.com/t/auto-detect-the-type-of-hmd/36271/3 "2015-07-23T15:49:23Z")

</div>

Thank you, Opamp77!

I will make this as node into mine Blueprint library 🙂

At this moment I am using around way - I am checking, does HMD is active -\> get Controller IDs. If there is no IDs - then HMD is Oculus.

Thank you once again!
