SetText has no effect after `Event Construct` in a user widget

I have the following event graph in a user widget

Capture

where NameText is a TextBlock, declared here
Capture
.

When the game starts, the text is correctly set to initial, but when the ShowName event is fired the text doesn’t update, even though after update is successfully printed to the console right after.

I’m completely at a loss. I’m confident the text is not being set to something else elsewhere

Just guessing, the Construct is called multiple times and overrides the Name change immediately.
Try to add a DoOnce Node after the Construct begins, to make sure, Construct isn’t called multiple times.

Unfortunately that didn’t help. Thans for the suggestion, though

Have you set a Print String on the Event Construct to see if it fires again as Patrick suggested? Also any chance you are setting the same text anywhere else?

Hope you solve this soon!

Yes I gave that a shot. I’m 100% confident the text isn’t getting set from elsewhere, and I’ve tried other actions like Set Visibility that also have no effect. For some reason, after the construct event I can’t modify anything about the text block

Ok, just to clarify…

At first you said :

but then:

After Event Show Name fires, is there no text at all showing or just what was there before? (Initial)

It depends on the initial state that’s set during construct. If the text is showing once the construct is finished running, then I can’t get it to hide, and vice versa. Essentially, the TextBlock widget cannot be altered via the ShowName event. I brought up the Set Visibility function because I realized this isn’t just a problem with SetText. I cannot pass my NameText widget into any of the widget helper functions and have something happen inside ShowName.

Everything works fine in the construct.

Figured it out. I was calling the SetName function on the wrong instance of my widget blueprint

1 Like