Download

Seriously, when two widgets are created

When I call the variable of the other widget, it doesn’t work sometimes.

Does anybody know this mystery?

Ex) I’ve made Main Widget and Drop Widget.

When “Drop?” Variable is checked in the drop widget, a function of the main widget should be operated.

But as I checked by nailing print string nodes to find out the error, always this calling variables of the other functions is the place where I get stuck.

did you check if all references are valid before trying to access them?

Hello,

It’s possible I’m not understanding what you are doing, but setting a variable does not trigger any code execution, it just sets the variable. That’s it!

Here I set a member variable of an other blueprint, the “SomeEvent” could be when you press a button in a UMG widget.
106bafbc3664b5831b5abf0316de1e7100985d28.png

And here I’m trying to execute “Do a thing” or “Do another thing” when “Should Do Something?” changes. But this will NOT work! The branch will not be automatically executed when the variable changes. The code in the picture below will ONLY execute when the event “SomeOtherEvent” is called.
163a34867ffbf5a3e5b487c1ff61f61badb369f9.png

To fix this, you could call “SomeOtherEvent” after setting the variable.
4626513880518aabab8c95156e4e285a519dea1c.png

Or change things a little:
b8ff430ea7c58330ae54e95e4a6afc80a4837a65.png
and
702477941738edd4003fb6124587b6c06f294e63.png

Here I used events, but it could be functions too.