Download

Use Motion Controllers from C++

Hi!

I want to get a reference to motion controllers added via blueprint in code. I have added dependency to HeadMountedDisplay into my .Build project file.

PrivateDependencyModuleNames.AddRange(new string] { “HeadMountedDisplay”, “SteamVR” });

Then I have include the listed below headers:

#include “Runtime/HeadMountedDisplay/Public/HeadMountedDisplay.h”
#include “Runtime/HeadMountedDisplay/Public/MotionControllerComponent.h”

I can create a variable like this: UMotionControllerComponent MController;*

But I can’t access to public functions, properties… of the class using MController->… because seems like this class is not recognized.

Any tip??

Thanks