[C++] How to setup child actor component in the constructor?

I was wondering how to setup child actor components in C++ and have them correctly exposed in Blueprint.

My current code is:


UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
UChildActorComponent* GunSlot;


GunSlot = CreateDefaultSubobject<UChildActorComponent>(TEXT("GunSlot"));

The problem is none of the details are exposed:

Desired solution (Done in BP):

My goal is to learn C++ and keep BP usage minimal.

Try EditAnywhere instead of VisibleAnywhere

It somewhat worked, I just don’t have access to as much details. I figured out how to attach the weapon to a socket in C++. But, I’m still looking to see if what I want is possible.

Thanks Ali