Set Visibility of Widget from another Widget
Essentially I have a main menu widget, and an options widget. This seems the best way to do it, unless I'm wrong, instead of doing it all in one big widget blueprint. The problem becomes that I have to use create widget, and then destroy said widget every time, instead of just unhiding and hiding the options menu.
I am not sure how to let two widgets... see each other and their variables though, so that they can interact with them. Like I'd like the options menu to be able to hide itself and at the same time, unhide the main menu, but they can only interact with their own variables it seems.
asked Dec 24 '16 at 02:24 AM in Blueprint Scripting
You can use "Get All Widgets Of Class" to find the widget you want to touch, then call any functions that are in that widget to do your desired action.
So in your main menu have a function that unhides itself when called. Then in your options menu call "GetAllWidgetsOfClass -> MainMenu" -> "Unhide MainMenu function".
Alternatively (and probably less performant), you could probably also put a variable on your character or in your game mode, that those widgets then watch to determine if they should be visible or not.
Basically, "isInOptionsMenu" bool on your character, and the MainMenu/Options hides/unhides itself whenever that value changes.
answered Dec 24 '16 at 07:37 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here