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
Also if you want to set visibility of another widget you can simply use this Blueprint. Inside the Get All Widget of Class function I selected the widget I wanted to modify. Note that Top Level Only is unchecked.
answered Apr 04 '17 at 04:57 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here