Hi!
I’m using Unreal 5.3.2.
I have these C++ class:
public:
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<USceneComponent> VROrigin;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UMotionControllerComponent> MotionControllerLeftGrip;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UMotionControllerComponent> MotionControllerRightGrip;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UMotionControllerComponent> MotionControllerLeftAim;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UMotionControllerComponent> MotionControllerRightAim;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UXRDeviceVisualizationComponent> XRDeviceVisualizationLeft;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UXRDeviceVisualizationComponent> XRDeviceVisualizationRight;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<USkeletalMeshComponent> HandRight;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<USkeletalMeshComponent> HandLeft;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UWidgetInteractionComponent> WidgetInteractionLeft;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UWidgetInteractionComponent> WidgetInteractionRight;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UCameraComponent> Camera;
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TObjectPtr<UStaticMeshComponent> HeadMountedDisplayMesh;
With the constructor:
SNVRPawn::ASNVRPawn()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
VROrigin = CreateDefaultSubobject<USceneComponent>(TEXT("VR Origin"));
SetRootComponent(VROrigin);
MotionControllerLeftGrip = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Motion Controller Left Grip"));
MotionControllerRightGrip = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Motion Controller Right Grip"));
XRDeviceVisualizationLeft = CreateDefaultSubobject<UXRDeviceVisualizationComponent>(TEXT("XRDevice Visualization Left"));
XRDeviceVisualizationRight = CreateDefaultSubobject<UXRDeviceVisualizationComponent>(TEXT("XRDevice Visualization Right"));
MotionControllerLeftAim = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Motion Controller Left Aim"));
MotionControllerRightAim = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Motion Controller Right Aim"));
HandLeft = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Hand Left"));
HandRight = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Hand Right"));
WidgetInteractionLeft = CreateDefaultSubobject<UWidgetInteractionComponent>(TEXT("Widget Interaction Left"));
WidgetInteractionRight = CreateDefaultSubobject<UWidgetInteractionComponent>(TEXT("Widget Interaction Right"));
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
HeadMountedDisplayMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Head Mounted Display Mesh"));
MotionControllerLeftGrip->SetupAttachment(RootComponent);
XRDeviceVisualizationLeft->SetupAttachment(MotionControllerLeftGrip);
HandLeft->SetupAttachment(XRDeviceVisualizationLeft);
MotionControllerRightGrip->SetupAttachment(RootComponent);
XRDeviceVisualizationRight->SetupAttachment(MotionControllerRightGrip);
HandRight->SetupAttachment(XRDeviceVisualizationRight);
Camera->SetupAttachment(RootComponent);
HeadMountedDisplayMesh->SetupAttachment(Camera);
MotionControllerLeftAim->SetupAttachment(RootComponent);
WidgetInteractionLeft->SetupAttachment(MotionControllerLeftAim);
MotionControllerRightAim->SetupAttachment(RootComponent);
WidgetInteractionRight->SetupAttachment(MotionControllerRightAim);
}
I have created a blueprint class which inherits from the previous C++ class. But, when I check the Components in the Blueprint class I realise that there are two ArrowComponents:
Where these ArrowComponent come from?
Thanks!