# \[4.17.2\] UHeadMountedDisplayFunctionLibrary::ResetOrientationAndPosition() Error

**URL:** <https://forums.unrealengine.com/t/4-17-2-uheadmounteddisplayfunctionlibrary-resetorientationandposition-error/407127>\
**Category:** Character & Animation\
**Tags:** error-compile, unreal-engine, question, CPP\
**Created:** [October 16, 2017, 9:50am UTC](https://forums.unrealengine.com/t/4-17-2-uheadmounteddisplayfunctionlibrary-resetorientationandposition-error/407127 "2017-10-16T09:50:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_9257592b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9257592b](https://forums.unrealengine.com/u/anonymous_user_9257592b)\
**Post date:** [October 16, 2017, 9:50am UTC](https://forums.unrealengine.com/t/4-17-2-uheadmounteddisplayfunctionlibrary-resetorientationandposition-error/407127/1 "2017-10-16T09:50:07Z")

</div>

Hi hi  
I was created a blank c++ project (TestProject) and created other c++ template project of thirdperson (TempProject)

In TestProject, I create a character c++ (MyCharacter)  
In MyCharacter class, I was following the TempProject, the TemplateCharacter class  
however the error occur

 ![216799-inkedcapture-li.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/6/d9647fec0021a215457a65d787fa94975171cfe1.jpeg)

the problem of the error is the line of code

UHeadMountedDisplayFunctionLibrary::ResetOrientationAndPosition();

may i know why and how to solve it ?  
thanks 😃

---

<div class="post-metadata">

**Author:** ![Dune](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dune](https://forums.unrealengine.com/u/Dune)\
**Post date:** [October 16, 2017, 11:16am UTC](https://forums.unrealengine.com/t/4-17-2-uheadmounteddisplayfunctionlibrary-resetorientationandposition-error/407127/2 "2017-10-16T11:16:06Z")

</div>

Looks like your code doesn’t know what the function is. You may need to include the header for the code to be found. The documentation for the function can be found here: [https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Kismet/UHeadMountedDisplayFunctionLibra-/ResetOrientation-/index.html](https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Kismet/UHeadMountedDisplayFunctionLibra-/ResetOrientation-/index.html).

At the bottom, it shows what module and header will be needed - “#include Runtime/Engine/Classes/Kismet/HeadMountedDisplayFunctionLibrary.h”

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9257592b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9257592b](https://forums.unrealengine.com/u/anonymous_user_9257592b)\
**Post date:** [October 17, 2017, 4:53pm UTC](https://forums.unrealengine.com/t/4-17-2-uheadmounteddisplayfunctionlibrary-resetorientationandposition-error/407127/3 "2017-10-17T16:53:30Z")

</div>

Thanks  
is a mean need to add the whole path ??  
cause  
the default is:  
#include “HeadMountedDisplayFunctionLibrary.h”  
however error, I have been try  
#include “Kismet/HeadMountedDisplayFunctionLibrary.h”  
but is failed as well…  
thanks:D, i try

---

<div class="post-metadata">

**Author:** ![DanielPadilla](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DanielPadilla](https://forums.unrealengine.com/u/DanielPadilla)\
**Post date:** [October 27, 2017, 8:10am UTC](https://forums.unrealengine.com/t/4-17-2-uheadmounteddisplayfunctionlibrary-resetorientationandposition-error/407127/4 "2017-10-27T08:10:24Z")

</div>

Hi Ka Wai,  
Try adding a string “HeadMountedDisplay” to the PublicDependencyModuleNames variable in your [ProjectName].Build.cs file (probably FYP\_Game\_Development.Build.cs file).

Somewhat like this:

```
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" });

```

Hope this helps.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_202dd017](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_202dd017](https://forums.unrealengine.com/u/anonymous_user_202dd017)\
**Post date:** [May 25, 2018, 3:29pm UTC](https://forums.unrealengine.com/t/4-17-2-uheadmounteddisplayfunctionlibrary-resetorientationandposition-error/407127/5 "2018-05-25T15:29:45Z")

</div>

This was the problem for me. Thanks!

---

<div class="post-metadata">

**Author:** ![TheFlow3k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheFlow3k](https://forums.unrealengine.com/u/TheFlow3k)\
**Post date:** [June 20, 2020, 9:24pm UTC](https://forums.unrealengine.com/t/4-17-2-uheadmounteddisplayfunctionlibrary-resetorientationandposition-error/407127/6 "2020-06-20T21:24:57Z")

</div>

I had this situation today, also in Unreal 4.25. It happens when starting with a **blank UE4** project and **then adding a First Person or Third Person UE4 Template Pack**. On adding the template changes to project files are needed, because a blank UE4 project is missing HeadMountedDisplay.

Solution, adding  
`, "HeadMountedDisplay" `  
here in file: [YourProjectName].Build.c

```
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" });
```

---

<div class="post-metadata">

**Author:** ![ShatteredGames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ShatteredGames](https://forums.unrealengine.com/u/ShatteredGames)\
**Post date:** [May 15, 2024, 4:28pm UTC](https://forums.unrealengine.com/t/4-17-2-uheadmounteddisplayfunctionlibrary-resetorientationandposition-error/407127/7 "2024-05-15T16:28:23Z")

</div>

When landing here after upgrading a project to 5.4(.1)

Add XRBase as module to PublicDependencyModuleNames

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/e/d2ef1458c2b4dc2e7c79de4b231fa96be82ddcd6.png)
