# Depricated VR c++ libraries UE 5.4

**URL:** <https://forums.unrealengine.com/t/depricated-vr-c-libraries-ue-5-4/1899065>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [June 11, 2024, 2:23pm UTC](https://forums.unrealengine.com/t/depricated-vr-c-libraries-ue-5-4/1899065 "2024-06-11T14:23:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zombie.SoC1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zombie.SoC1](https://forums.unrealengine.com/u/Zombie.SoC1)\
**Post date:** [June 11, 2024, 2:23pm UTC](https://forums.unrealengine.com/t/depricated-vr-c-libraries-ue-5-4/1899065/1 "2024-06-11T14:23:28Z")

</div>

Hello,

just trying to get my c++ scripts compatible with UE 5.4 (original was 4.272)  
and now compiling shows probable incomatibility with certain libraries i use:

`"XRMotionControllerBase.h"` and` "HeadMountedDisplayFunctionLibrary.h"` - cannot be included any longer. Does anybody now the correct include path or if these libraries were replaced by some other ? 🫠  
Basically i just wanted to set the Tracking Origin to Floor  
`UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Floor);`  
and some minor other stuff…

---

<div class="post-metadata">

**Author:** ![Zombie.SoC1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zombie.SoC1](https://forums.unrealengine.com/u/Zombie.SoC1)\
**Post date:** [September 11, 2024, 9:34am UTC](https://forums.unrealengine.com/t/depricated-vr-c-libraries-ue-5-4/1899065/2 "2024-09-11T09:34:31Z")

</div>

that seems to be the case  
The tracking origin is now based from the OpenXR plugin and can be set in Blueprint (did not find it c++).  
But the new character class is such, that its capsule component is not moving with the VRplayer movements in real space. This might be solved by [https://forums.unrealengine.com/t/collision-capsule-not-following-vr-movement/1467324](https://forums.unrealengine.com/t/collision-capsule-not-following-vr-movement/1467324).  
I am still wondering - if there is a better solution this…

---

<div class="post-metadata">

**Author:** ![Zombie.SoC1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zombie.SoC1](https://forums.unrealengine.com/u/Zombie.SoC1)\
**Post date:** [September 12, 2024, 1:23pm UTC](https://forums.unrealengine.com/t/depricated-vr-c-libraries-ue-5-4/1899065/3 "2024-09-12T13:23:10Z")

</div>

just to continue this topic, now that i understood the problem i run into better:

The VR template in unreal derives from pawn class, that does not have a capsule component nor uses the built in “character movement component”. It is though possible to switch the parent class to character, by which the character movement component (and a capsule component) is added.  
This can be found in various tutorials about “Enhanced Movement inputs” - and seemed to be a good idea to use the character movement component.

But 😑 this comes with a component hierarchy, where the capsule component is root (and parent of camera). When the VR player is moving in real world - a relative location offset to the parent is added to the camera component. In other words: the capsule component is of course not moving with the camera. Which i assumed was somehow solved by the named depricated classes - but now i am not so sure about it any more 😅

changing the hierarchy - root in the characterclass (decoupling cam and capsule component parenting) - can with some extra function solve it: update **relative location change** for capsule component. But… the character movement component is somehow hard-wired to the capsule component, and leads in case of decoupling the parenting to the camera to: capsule component runs without the camera. Now one might come up with some sneaky update call for the camera relative location - but in a way this is just adding unnecessary location corrections that need to run with tick - at least as long a button for movement is pressed.

To solve this, although it pains:

- only use the pawn class for your VR character
- write your own movement component → or input to walk functionality and apply any change in location and rotation directly to the root component.
- correct for the relative location offset by player movement in real world for the components the other components that are not parented to the camera.

A small note, why this is needed: if you want a rigged body you do not want this to be a child to the camera by certain reasons in the rigging.
