Can i activate-desactivate a boolean from a widget from a different level?

Hello,

Ok my question is,

I did a widget for my Main Menu (Map 1) and from there, i can activate-desactivate my equipment through setting the Boolean to true-false with a button, but the problem is that if i open another level (Map 2) through the Main Menu (Without leaving the PLAY, i haven’t tested it, that’s why i’m asking the question), do i still have the boolean activate-desactivate according to what i want?

I have another question, thought a noob question that everybody know (But i forgot).

If i have my Boolean’s Default Value to false, does the boolean go to TRUE or False in a branch if i changed the boolean to TRUE in a SET Boolean? Or do i have to put it TRUE in the Default Value to go the TRUE way?

If you are opening a 2nd map, I believe the Main Menu widget will end up getting destroyed. Typically when I have settings that I need to access in multiple maps(like your boolean that you can change in the Main Menu), I store the settings in a persistent object/blueprint. For example, I will create a custom Game Instance and store my settings there. A Game Instance object is created On Game Launch and isn’t destroyed until the player quits the game, and you can access it anywhere with the Get Game Instance blueprint node.

For your 2nd question, it seems like you don’t have a complete understanding of coding basics, so I would recommend maybe completing a few more blueprint tutorials. There are lots of great tutorials by Epic and the community on youtube. I’ll answer your question though. The Branch Node doesn’t care about the default value of the bool. The Branch Node will read the bool’s current value when the Branch Node is called and go down the appropriate path.

Thanks for the answer,

May i ask you some question more about the Game Instance?

1.Can i acess it throught the Widget like Casting the Game Instance (Since i only know that this is the only way to get into the blueprint’s variables). I know you said i can acess it anywhere, but to make sure because i can’t acess my character blueprint. I did test it with a print and it looks like it can’t pass over my character blueprint.

2.I only need to create the game instance and then it will works? I mean, i don’t need to activate it from somewhere to let it work?

  1. Yes, you can access your game instance in your widget exactly how you described. Just use this node.
  2. After you create your Game Instance you need to tell your project to use it by going to Project Settings>Maps & Modes>Game Instance.