Details panel display differences

Why does the details panel look different when adding a USphereComponent in code vs adding it from the “Add Component” button in the editor?

When the USphereComponent is created via code the Details panel looks like this:

SphereComp = CreateDefaultSubobject<USphereComponent>(TEXT("SphereComp"));

But when it is created by clicking the “Add Component” button in the editor it looks like this:

Anyone have any idea about this one? It has been bothering me for a while now :slight_smile:

This happens when you are using a pointer with UPROPERTY specifier EditAnywhere or EditDefaultsOnly. Try changing to VisibleAnywhere or VisibleDefaultsOnly.

// This will show the first image, with a drop down box for SphereComp.
UPROPERTY(EditDefaultsOnly)
USphereComponent* SphereComp;

// This will show the second image, the same details display as when adding from the Blueprint's "Add Component" button.
UPROPERTY(VisibleDefaultsOnly)
USphereComponent* SphereComp;