I am trying to create a composite scene component, i.e. USceneComponent which contains another USceneComponent (UStaticMeshComponent). During runtime everything seems working fine. But unfortunately I cannot edit this sub component in Blueprint Editor. Here are a couple of screenshots so you would understand what I am talkin about:
Here is the code. As you see UHUDComponent contains UStaticMeshComponent inside.
This is how blueprint editor looks like:
On the left in the component tree pane you can see that the root component of the actor which is ShipMeshComponent contains HUDComponent, which itself contains Mesh1. When I click on Mesh1 its details pane is empty - I cannot edit it (move, rotate, etc.) But at the same time it is on the scene (It is highlighted inside the UFO mesh. It’s a ball).
Now if I click on HUDComponent and try to edit Mesh1 from there:
I moved to UE 4.8.2 and tried to test the issue again - I changed X location of the subcomponent and Unreal BLueprint Editor crashed right away. Here is the message:
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;
};