Widget text not updating

Hi everybody,
here what I’m tryng to do:

  • I click on an object in my level
  • It appears a menu with three buttons
  • Clicking the buttons I change the object and set values for two variables
  • if I go on pause I can see the values of the two variables shown in a box

how I’ve done:

In the widget “Menu_PopUp_A2” I set different values at the two variables “PA_Scritta” and “PA_Price” depending on which button I’m clicking
In the widget “Pause_Menu” I created two text variables “Testo-A” and “Price-A” and bound to two different boxes as content; the value of the two text variables is set at the event construct by the two cast variables “PA_Scritta” and “PA_Price” (converted in text)

What’s the problem:
Since I’m setting the two text variables at the event construct of the widget, the boxes should be always updated when I add to the viewport the widget, but it works only the first time I add it and then remain fixed on the value of the first time!

Don’t mind to the warning of the “cast to” in the “Menu_PopUp_A2” screenshot: in theory I’ve done all right and practically works perfectly without problems

I’m a real newbie so I’m sorry if my question is dumb but even looking at “parallel” tutorials (like the inventory one) I’m not figuring what is missing or what I’m doing wrong!

Does your cast to need to be a direct link? I.e. a variable that the variable type is “the blueprint it wants to access”. So If I a ma human and want to speak to a robot, my variable type needs to be “a robot” and then link that to your robot blue print from your human blue print.

AddToViewport does not call the constructor. AddToViewport takes an already existing widget and makes it visible within the HUD.

In MenuPopupA2:

When the OnClicked(A1_Button), OnClicked(A2_Button), and OnClicked(A3_Button) events execute, the branch from Event Construct is not fired and GetAllActorsOfClass->Get[0]->CastToBP_Ottoman do not execute.

In order for those nodes to execute after OnClicked, you need to place them within the execution branch of those events; but what you should really do is Set the variable once in Event Construct; and then Get the variable value during each OnClicked event.

In PauseMenu:

You’re calling RefreshPriceA every tick; you only need to call this when the prices/display changes. Calling every tick is a bit much; especially when you’re calling “GetAllWidgetsOfClass” to pull the 0 index widget every frame.