I am trying to follow A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums,Making_Native%26_Deferred_Attached_to_Socket in order to attach some custom components I have written to their sockets.
UVRItemAcceptor inherits UVRInteractionComponent which inherits USkeletalMeshComponent.
From the headers of my components
UCLASS()
class UVRItemAcceptor : public UVRInteractionComponent
{
GENERATED_UCLASS_BODY()
};
UCLASS()
class UVRInteractionComponent : public USkeletalMeshComponent
{
GENERATED_UCLASS_BODY()
}
In my VRCharacter.h
UPROPERTY(VisibleAnywhere, Category = "Inventory Components")
TSubobjectPtr<UVRItemAcceptor*> Chest1;
EDIT:
Should be
UPROPERTY(VisibleAnywhere, Category = "Inventory Components")
TSubobjectPtr<UVRItemAcceptor> Chest1;
In my VRCharacter.cpp
Chest1 = PCIP.CreateDefaultSubobject<UVRItemAcceptor>(this, TEXT("Chest1"));
Chest1->AttachParent = Mesh;
Chest1->AttachSocketName = FName(TEXT("Chest1_Socket"));
The last 2 lines have red squiggly under Chest1 and claim expression must have a pointer to class type. Does anyone know why this is? Have I messed up something when making my new component types?