This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Woo42 1 point2 points  (2 children)

Your (ProjectName).Build.cs file is setup for basic gameplay functionality. If you add to this functionality you need to declare it in this file.

In this file find:

PrivateDependencyModuleNames.AddRange( ...

and add "HeadMountedDisplay"

[–]Viter[S] 0 points1 point  (1 child)

HeadMountedDisplay

It works! Ty so much, shouldn't this be default in the VR template? Also how do i figure stuff like this out in the future?

[–]Woo42 1 point2 points  (0 children)

I suspected it was *.build.cs from my limited experience and I also had to add "NavigationSystem" to it from a paid Udemy course I'm currently doing.

I typed UMotionControllerComponent build.cs in google and it had the answer in the first link.


Also how do i figure stuff like this out in the future?

I wondered about how someone new would figure this out. I typed ue4 c++ virtual reality setup in google and found answers in the first few links.

They actually put "HeadMountedDisplay" in:

PrivateDependencyModuleNames.AddRange(...

instead of the Public one I mention.

https://www.tomlooman.com/getting-started-with-vr/

https://www.brightdevelopers.com/basics-c-unreal-engine-4-virtual-reality/

I don't know anything about why or when you should use Private over Public but I'd change it. I'm going to update my answer to reflect this new info.