Download

Umg widget how to load a value

Hi,

how can i load a value when i open a widget ? there is no event begin play on widget fonction.

i want to call a variable of my character for set a temporary value who can be change when the widget is open and don’t save the value in my character if the widget is close or no apply bouton press.
And when i reopen the widget, i wand to load again the character variable.

My widget bp work exepte i need to set the temporary value in the widget.

If i use event focus that work but all the values are reload if i don’t click on a widget button. and event construct dont load the values.

Someone have a solution for that ?

thx

i have find an other way for load value but it’s not a clean way.

stile looking for a solution.

thx

Hello,
If you can’t set your value on event construct, you can create a custom event in your widget event graph where you set your value and call it from “return value” or variable reference when you “create widget” or “add viewport”.

Thx for the answer.

i have now an other problem of same type.

i have make an event on a bp and i want call the function by casting the BP for call the event. But the event is never call when click on a button.

any idea ?

I can’t be sure as i don’t see your blueprint graph but trouble can be the reference. It can be the need of “enable input” node before doing your event too.

Hi,

I just take that 2 screens.

When i press the button that never call the event and the print string.

If you have a solution ?

Thx

event-problem1.jpg

event-problem2.jpg

You use a “get player character” to “cast to your controller”. You have to “get player controller” to have it working (Check that you’ve set your controller in your game mode too.)

ok, my mistake…

thx