Changing a variable in a different menu widget. How?!

I am helplessly confused. I’ve read and watched videos for days and every time I seem to find a solution I can’t get it to work for this instance. This seems like the most basic form of computing ever. Please help me to finally understand what I’m unable to wrap my head around.

For this example, I’m working on a cocktail app. Users are able to select the type of Spirit, Flavor, etc. Each category is a separate menu overlay which slides in (once the category is selected) and out (once a selection is made in that category).

The Main Menu calls the secondary menus via an OnClicked event, which also sets a bool variable. The ‘Spirits’ menu sets the bool ‘OpenMenuSpirit’ to true. What I can’t seem to figure out is how to set the ‘OpenMenuSpirit’ bool to false once someone selects ‘Vodka’ on the secondary ‘Spirits’ menu.

Attached are blueprints for the MainMenu and SpiritMenu.

Main Menu

Spirit Menu

Thank you,

You need to get main menu refrence, you got refrance to spirit menu in main menu returned from “Create… Widget” node, send main menu reference somehow there (Set varable in there?).

But i see a bigger problem, Main Menu object can be dead at the time user clicks a button as it got removed from viewport right? In you place i would create center widget class with box and switch between them then child widget can communicate with parent widget quite easily without joggling with references and risk main menu and it memoery data destruction.

Btw if you not aware blueprint widget… is a widget it self and it can be contained in other widget and you can dinamicly create them destroy them as well as change visibility which can be more effcient, utilize that

Your explanation sounds correct, but I still don’t completely understand how to go about implementing it.

The Main Menu is comprised of three buttons and text fields that will display what was chosen. Currently, those buttons are floating in the main Canvas Panel and are only being turned to True or False via the Set after the Branch. (How would it be dead?). I’m only Removing from Parent the Spirits Menu because I haven’t gone through animating it yet. (I don’t plan to remove it in the future). I’d also like to enable/disable each menu with a bool so the other menus are locked out when one is active.

  • What is the best way to get the reference to the Main Menu?
  • I’m not sure how I’m referencing the Spirits Menu? I thought I was just instantiating it into the project/view with Create… Widget? (so I guess I really don’t understand how I can use the input further)
  • I’m not sure how to do what you’ve spoken of in the second paragraph. Is there a tutorial or example you could point to?

I’ll keep reading through and trying to figure it out in the mean time. Thanks!

  • What is the best way to get the reference to the Main Menu?

Create a variable of the type “Main Menu Reference” inside of “Spirit Menu”. When you create “Spirit Menu”, set that variable using the return off of the construct widget node and set the variable to self (when creating it inside “Main Menu”). Use an is valid node to check if the reference is still valid and then you can use that to set your Boolean value or any other variable if it is.