Why is value not getting passed from my UI Widget to a Blueprint?

Hey,

I’ve got a widget where a user input duration of time and I’m trying to get this passed across to another blueprint where this data will be used.

For some reason the variables set in the widget always returns 0 in the actor blueprint. These variables definitely get values appended in the widget, I tested this using print string, however when I try to call these values from the actor blueprint these numbers go to 0. The blueprint where I’m calling these values is as below:

Strangely, I can call the inputbox values from the actor blueprint, but this pulls in the default value and not the value the user inputs.

Any help would be much appreciated.

Cheers,

Are you sure you are creating your widget properly? “Create Widget” doesn’t actually draw anything so you’ll need to add it to something.

Are you sure you are creating your
widget properly? “Create Widget”
doesn’t actually draw anything so
you’ll need to add it to something.

You do not need the widget in the viewport/canvas to send it data. It will not Tick but you can still call its members.

For some reason the variables set in
the widget always returns 0 in the
actor blueprint. These variables
definitely get values appended in the
widget, I tested this using print
string, however when I try to call
these values from the actor blueprint
these numbers go to 0. The blueprint
where I’m calling these values is as
below:

Where exactly are you sending the data to the widget or vice versa. There’s nothing in your screenshot that indicates that you are doing it. Use the SessionMenu to access widget’s data.

Also, switching levels destroys widgets. (correct me if I’m wrong here, it’s been a while)

Thanks Everynone.

I figured this out. I had to setup a gameInstance and define these variables there. Its working now :slight_smile:

That’s great! Consider marking this issue as resolved if it’s working as intended now.