How to set variable from another blueprint?

Hello,

I’m trying to set public bool variable hasStarted from BP_BalonkyGameMode, so my method is that in the blueprint where I need it WBP_MainMenu I get a reference for BP_BalonkyGameMode like so:

Then when button is clicked I change that variable to true:

But in BP_BalonkyGameMode is still false after that change:

Do you know where I could be possible wrong? Thank you very much!

  1. Minor point, you can use GetActorOfClass, no need for the get node.

  2. Anything after an OpenLevel node is binnned, because a new level has started. The game mode is also chucked away.

  3. Tick runs EVERY FRAME. So if we got this far, once ‘has started’ became true, you would be calling ‘start game’ every frame. Probably not what you meant.

  4. Is the logic right there? Surely this should be connected here:

image

It seems the main effect you’re trying to achieve is to start the game, when the button is pressed? Then just connect and ‘open level’ to the button :slight_smile:

1 Like

Try use interface, when construc send call to interface envent and set the bool var.