Random Text Not Showing in Widget(UE5.4)

I’m trying to create a system where a ball passes through a specific location and a random event message is displayed. Once a message is shown, it should never appear again.

The random selection of messages works correctly, and duplicates are avoided as intended. However, the message is not being displayed on the screen. I suspect something is wrong, but I can’t figure out what.

Most of the logic is handled in the Game Instance.

I’m using two Widget Blueprints:

  • One contains only a Canvas Panel and a Text Block (for showing the message)
  • The other contains a Canvas Panel with a Vertical Box (for listing/displaying messages)

Could you help me understand what might be going wrong?

I’m using Unreal Engine 5.4.

Apologies for the mix of languages in the Blueprint.

Thank you in advance!

snippets


@kkun how you are displaying both of the widgets, like are you adding both of the widgets to viewport?

@alirizvi7861

Thank you for your question!

Regarding how I’m displaying the widgets:

My implementation displays the widgets as follows:

  1. WBP_MessageLog (the main container widget):
  • This widget is created once at game start (within the Event Init event of my Game Instance) and then added to the viewport using an Add to Viewport node.
  • This widget contains a Vertical Box (named MessageContainer) which serves as the container for messages.

  1. WBP_EventDisplay (the individual message display widget):
  • This widget is created whenever a new message needs to be displayed (within the ShowNextMessage event of my Game Instance).
  • After creation, this WBP_EventDisplay widget is added as a child to the MessageContainer (Vertical Box) within my WBP_MessageLog using an Add Child node.

So, only WBP_MessageLog is directly added to the viewport, and WBP_EventDisplay widgets are added hierarchically as children of WBP_MessageLog.

Is this approach incorrect?

@kkun so you can see on screen messages shown by print string?
I think there’s problem with your individual message widget.
try adding those manually as child in container with some text not at runtime but in your parent widget, just add 2, 3 and check if they are shown there, i think there’s alignment issue perhaps.

@alirizvi7861

Thank you for your reply.
I’ve confirmed that the random message is being selected correctly using the Print String node.
Also, if I replace Add Child with Add to Viewport, the selected message does appear.

As shown in the screenshot, I tried adding both a Text Block and the widget into a Vertical Box, but nothing seems to be displaying.

Here’s the full overview:


Hey there,

Have you tried using “Add Child to Vertical Box” instead?
If that doesn’t work try playing around with anchor points in EntryDisplay widget.

Is it possible that one of your timers is interfering with it too?

@DonBusso

Thank you for your reply.

I have tried replacing “Add Child” with “Add Child to Vertical Box,” but the widgets still do not appear.

I also experimented with changing the anchor points as you suggested, but it did not resolve the issue. To rule out any timer interference, I disconnected the timers and tried to display the widget with a left-click event, but it still did not show up. I even temporarily disabled the “RemoveFromParent” node, but the result was the same.

The “IsValid” check placed before “Create WBP EventDisplayWidged” confirms that the Vertical Box reference is valid and functioning correctly.

For clarity, I have also set all text and the Vertical Box to be anchored to the top-left corner, but this has not made them visible either.

(A screenshot of the new layout is attached.)


Thank you for your continued help. I’m looking forward to any further suggestions you might have.

I tried replacing the Canvas Panel in WBP_EventDisplay (the one containing the Text Block) with a Size Box, but it still didn’t display.
Even when using just the Text Block on its own, the result was the same.

I followed the method shown in the screenshot to check whether the widget is actually being created, and it seems to be created correctly.
Just in case, I also checked WBP_MessageLog (the one with the Vertical Box), and it also appears to be created properly.

Is there anything else I should check?
I’m not sure where the issue is…