UWidgetComponent details missing

I know that UWidgetComponent is still experimental, but when I add a UWidgetComponent to my Character class in c++, its details are complete blank in editor. If I add a WidgetComponent to the Character via Blueprint, it works fine; if I duplicate the component, all the values are there too.

Has anyone run into this problem? Am I perhaps adding the component incorrectly?
The component is there, and anything I do to it in code shows up in editor, but I know this isn’t intended behavior.

It shouldn’t be this complicated… I just want the details panel to have all the options.
The declaration in the .h is:

UPROPERTY(EditAnywhere, Category = “HQCharacter”)
class UWidgetComponent *HealthBarComponent;

The definition in the .cpp is:

HealthBarComponent = CreateDefaultSubobject(FName(TEXT(“HealthBar”)));

Added in code:

Added in BP:


Hello LordDarkhan,

I’m not quite sure how that code is compiling for you, but the definition should be something along the lines of:

HealthBarComponent = CreateDefaultSubobject<UWidgetComponent>(TEXT("HealthBar"));

Also, it may be helpful to add the BlueprintReadWrite specifier to the UPROPERTY declaration, although I didn’t need it to have the details show up on my end.

Wow… I forgot to add the UWidgetComponen after CreateDefaultSubobject. I’m boosted.
Thanks, that was the issue.