Hi! So I’m just learning UE4 and There’s this one thing that confuses me about creating components via C++.
When I create couple components in actor like this:
UStaticMeshComponent* MeshComp1 = CreateDefaultSubobject(TEXT(“MeshComp1”));
UStaticMeshComponent* MeshComp2 = CreateDefaultSubobject(TEXT(“MeshComp2”));
RootComponent = MeshComp1;
MeshComp2->SetupAttachment(MeshComp1);
Only one of them appears in editor, usually the first one created or the one attached to RootComponent.
I know UPROPERTY might fix this, but some of the c++ tutorials for UE4 creates a component without UPROPERTY and it show up fine in the editor.