I have added two UMotionControllerCompoenents to my pawn class and in the editor I can see the motion controller mesh but when I package the game the mesh does not show in the packaged game.
Here is the code I used to add the motion controllers.
//Create motion controller components for VR controls
rightHand = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("RightHand"));
rightHand->SetupAttachment(RootComponent);
leftHand = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("LeftHand"));
leftHand->SetupAttachment(RootComponent);
if (rightHand != nullptr) {
UE_LOG(LogTemp, Display, TEXT("added right hand"));
}
//Make hand visual
rightHand->SetShowDeviceModel(true);
rightHand->SetTrackingMotionSource(FName("Right"));
rightHand->SetVisibility(true);
leftHand->SetShowDeviceModel(true);
leftHand->SetTrackingMotionSource(FName("Left"));
This is in the default constructor for my pawn. The log prints “added right hand” even in the packaged game so I know it isn’t null. I just don’t know why it isn’t visible.
Edit: with further investigation it seems to be the pawn that is hidden not just the oculus controllers. still no idea why.