# Detecting VR Mode

**URL:** <https://forums.unrealengine.com/t/detecting-vr-mode/34017>\
**Category:** XR Development\
**Tags:** unreal-engine\
**Created:** [July 1, 2015, 5:21pm UTC](https://forums.unrealengine.com/t/detecting-vr-mode/34017 "2015-07-01T17:21:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Porky\_Grout](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Porky\_Grout](https://forums.unrealengine.com/u/Porky_Grout)\
**Post date:** [July 1, 2015, 5:21pm UTC](https://forums.unrealengine.com/t/detecting-vr-mode/34017/1 "2015-07-01T17:21:33Z")

</div>

How in code do I detect VR Mode?

We based project on FP C++ template and to get VR mode and preview working we needed to reduce the collision capsule size otherwise it felt like I was 12 feet tall.

But then running in non-vr mode you are scurrying around the floor.

Ideally at Runtime my character class would check the mode and set the capsule size to something appropriate.

Is there a better way to handle this?

Thanks

---

<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 1, 2015, 9:40pm UTC](https://forums.unrealengine.com/t/detecting-vr-mode/34017/2 "2015-07-01T21:40:25Z")

</div>

This is what i normally use…

```auto

if ( GEngine->HMDDevice.IsValid() ) //check pointer is valid
{		
	if ( GEngine->HMDDevice->IsStereoEnabled() ) //check stereo enabled
	{
	//do stereo stuff
	}
}
else
{
//do other non stereo stuff
}
 

```

---

<div class="post-metadata">

**Author:** ![Porky\_Grout](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Porky\_Grout](https://forums.unrealengine.com/u/Porky_Grout)\
**Post date:** [July 2, 2015, 12:03am UTC](https://forums.unrealengine.com/t/detecting-vr-mode/34017/3 "2015-07-02T00:03:04Z")

</div>

Thanks. That worked.
