Userwidget OnConstruct for C++?

Probably a simple question but how do I add code to the OnConstruct for a C++ class deriving from UUserwidget? Because apparently it is a BlueprintImplementableEvent.

UFUNCTION(BlueprintImplementableEvent, BlueprintCosmetic, Category="User Interface", meta=( Keywords="Begin Play" ))
	void Construct();

Hi. You don’t need to do that. Instead, you have to override any of following function(s):

virtual void NativePreConstruct();
virtual void NativeConstruct();
virtual void NativeDestruct();

and don’t forget to call a parent function from implementations using Super::NativeConstruct() for example.

1 Like