Working with steam VR using C++

Hello,

I need a bit of guidance. I am working with steamVR. I want to create Motion Controller component using C++. But I cant find a way to do that. Is it possible to do that? if so what header files or setup do i need to do to achieve what I want? An example would be much appreciated if its possible.

Hoping for help soon.

Regards

Hopefully this tutorial from Tom Looman will help you, he also shows everything using C++:

Link

Thanks. Ill go through this and let you know how it goes.

It helped alot man. I needed to know how I can get the VR components and that link showed exactly how to do that. Only thing i couldn’t get was USteamVRChaperoneComponent for some reason. But ill figure that later i guess. Thanks a lot

I just quickly tested it on my side:

-Added the dependencies in the Build.cs:

“SteamVR”, “SteamVRController”, “HeadMountedDisplay”

-Included the necessary header file:

'#include “SteamVRChaperoneComponent.h”

-Afterwards I was able to create a new Chaperone Object:

USteamVRChaperoneComponent* Chaperone = CreateDefaultSubobject(TEXT(“Chaperone”));

EDIT:

Visual Studio doesn’t like it but it compiles, so it should work

I did that before. I tried it again. But it doesnt compile at all. Can I be possibly missing any thing? Its like the dependencies “SteamVR” and “SteamVRController” arn’t working at all. Also The motion controller are tracked but the are seen in sky box for some reason. Is that also because of not having SteamVRChaperone?

Going through all the project files I have found that the SteamVR header files are not been added to external dependencies folder of project.

Issue has been resolved. I refreshed project from UE once and now its picking everything up.