Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…
Hi Sam, I’m having an issue with this section, as the code works (no errors), the VR does play, and the Right Controller (Oculus Rift controller) is in the scene, but it doesn’t move at all?! I checked my batteries for the controller, all good, and I also ensured it’s working in other games and it does. Do you know what the issue could be? I could send you a git download if you don’t mind. Thanks greatly! I’m trying to figure this out for work.
That’s ok, I figured it out. I’m on version ue4.22 and you’re lesson is ue4.18 there was a VR bug that is occurring with controls that needed a patch to fix. All working now, so all good.
I was able to solve the tracking issue with the controller. If you are using UE 4.22 or above you must set the owner on the hand controller like so.
In the VRPawn.cpp add the following just below setting up the RightHandController
void AVRPawn::BeginPlay()
{
Super::BeginPlay();
if(HandControllerClass) {
RightHandController = GetWorld()->SpawnActor<AHandController>(HandControllerClass);
RightHandController->AttachToComponent(GetRootComponent(), FAttachmentTransformRules::SnapToTargetIncludingScale);
///Set Owner here and it should work
RightHandController->SetOwner(this);
}
}
Also … If you are the Oculus Rift or any Oculus platform you may notice that the floor is to close to your head.
You can fix this by opening the VRPawn blueprint and go to your event graph. Off of the begin play node you want to “Set Tracking Origin” and default it to “Floor Level”