Variables don't get the value I assign to them

I have a blueprint that assigns a positive value to a Boolean variable when an event fires; The problem is that when I use this value, it’s the default value instead of the value I’ve assigned to it. I’ve checked, and the part of the script that assigns the value to this variable is working correctly. I deleted and recreated this variable and the same thing happens. This error has occurred to me before, but I managed to get around it by implementing it in this same code, but now when I created this variable to save a value, only it can’t be assigned to anything, the rest works perfectly

can we see some code? i just fixed my stuff for something related to this. maybe i can help.

1 Like

This part is being executed, it is just not defining the variable.

so what i think is going on here is your not saving the variable, you need to save it. otherwise i have no idea really what im looking at, you need to get your game instance after your finished with the dialogue and then save the variable that needs saved. also the variable needs to be inside of the save system for it to save.

There are some worrying isses here:

  • Ticking the Get Actor of Class node - read its tooltip, it specifically tells you not to do it
  • binding every frame, non stop, 60+ times every second - doing it Once is enough
  • creating a widget but never doing anything with it, it’s not referenced, updated or added to the viewport

Consider addressing these issues first.


and the part of the script that assigns the value to this variable is working correctly.

Regarding the variable:

  • we don’t know how you test it
  • we don’t know what calls the dispatcher and sets the value of the boolean - the script above does not
1 Like

First, I create the widget to display the interact button and not show the rest of the images and dialogue elements. After he creates the widget he updates it showing the next dialog each time the Custom Event runs


I tested whether the event was executing by essentially placing a print statement that indicated if it was running, and it indeed printed. It essentially executes when an actor with the script comes into contact with the interaction hitbox.

Your widget remains unreferenced:

It will be removed from memory after 60s. Assign the Return Value to a variable. And we still cannot see where you call the dispatcher… You bind it here:

Where is the call?

I tested whether the event was executing

Which event?