CreateDefaultSubobject without UPROPERTY()

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.

If you want your components to be editable in the blueprint editor, you’re going to need to mark those components with the UPROPERTY macro.

Besides, for pointers to UObjects (or any derived object type), it’s just good practice. UObject pointers marked with as UPROPERTY are properly handled by the engine’s garbage collector, which is a good thing.

Plus, you need UPROPERTY for replication support, serialization, etc.

Bottom line: don’t shy away from using the UPROPERTY macro. It’s your friend.