I need to access UTextBlock and other widgets in my Widget Blueprint

My objective is to simply change the text “target” in my Widget Blueprint user interface. Below is my code in my **.cpp **file.

this is my .h file.

unreal2.png

this code compiled without any issue but during run time, the **target **returns false.

I appreciate for your time.

I think you may be misusing the BindWidget UPROPERTY tag. You shouldn’t need to call GetWidgetFromName, as target will already be bound to the correct UTextBlock object, provided that it’s name matches the variable name.