Hi I’m new here with C++ UE4.
I want to get access to Widget public function and set Widget variable from Other class (ThirdPersonCharacter)
It seems like it must using cast like below :
UMyUserWidger* MyUserWidget = Cast( ??? );
But I don’t know how to get UMyUserWidget Object which must pass to Cast function parameter. HELP please.
You need to have a UUserWidget Object, you can get it when you create the widget using CreateWidget.
For example:
UMyUserWidget* MyWidget = CreateWidget<UMyUserWidget>(this, WidgetClass);
Or you can create a generic UUserWidget object with CreateWidget and then cast it to your class.
WidgetClass in the example must be a
TSubClassOf < UMyUserWidget >