In Header:
protected:
UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
TSubobjectPtr BodyMesh1P;
UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
TSubobjectPtr BodyMesh3P;
UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
TSubobjectPtr WeaponMesh1P;
UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
TSubobjectPtr WeaponMesh3P;
Constructor:
AMyProjectCharacter::AMyProjectCharacter(const class FPostConstructInitializeProperties& PCIP) : Super(PCIP)
{
BodyMesh1P = PCIP.CreateDefaultSubobject(this, TEXT("MyBodyMesh1P"));
BodyMesh1P->AttachParent = CapsuleComponent;
Components.Add(BodyMesh1P);
WeaponMesh1P = PCIP.CreateDefaultSubobject(this, TEXT("MyWeaponMesh1P"));
WeaponMesh1P->AttachParent = CapsuleComponent;
Components.Add(WeaponMesh1P);
BodyMesh3P = PCIP.CreateDefaultSubobject(this, TEXT("MyBodyMesh3P"));
BodyMesh3P->AttachParent = CapsuleComponent;
Components.Add(BodyMesh3P);
WeaponMesh3P = PCIP.CreateDefaultSubobject(this, TEXT("MyWeaponMesh3P"));
WeaponMesh3P->AttachParent = CapsuleComponent;
Components.Add(WeaponMesh3P);
}
In editor:
Components are not attach to CapsuleComponent and “MISSING!! Native [C++VariableName or UnrealObjectName]” Tooltip showing. How can I fix it?