UPDATE:
Yet another update. I found added it via code didn’t allow me to save ALL subcomponent variables. So screw it, I’ll just add it via blueprints.
I used to have this problem in 4.11 and below. I wanted to give it another shot for my Rift game and perhaps debug it. I find it’s now working in 4.12.3. I’m glad this is now working, as I like this composition workflow and seems like such a natural fit.
My Component code:
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class POWER_API UPowerHands : public USceneComponent
{
GENERATED_BODY()
public:
UPowerHands();
virtual void BeginPlay() override;
virtual void TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction ) override;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = POWER)
class UMotionControllerComponent* LeftHandMotionController;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = POWER)
class USceneComponent* LeftHandSceneComponent; //fine tune pivot point if needed
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = POWER)
class USkeletalMeshComponent* LeftHandMeshComponent;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = POWER)
class UMotionControllerComponent* RightHandMotionController;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = POWER)
class USceneComponent* RightHandSceneComponent; //fine tune pivot point if needed
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = POWER)
class USkeletalMeshComponent* RightHandMeshComponent;
};
I then add my new Component.
PowerHands = CreateDefaultSubobject<UPowerHands>(TEXT("POWER_PowerHands"));
PowerHands->SetupAttachment(GetCapsuleComponent());
Note: You can only edit by clicking the root component. PowerHands in my case.