So ive got a simple main menu set up that is fully functioning, only problems i’m having is the return button in my options menu. this is what i have so far and currently does not work. This is what i have for my main menu which works all fine and dandy.
When you use “Remove from widget” it probably destroys itself so the rest of the code which creates the menu never runs! Create the widget, and run Remove from parent last.
In my game rather than use the remove from parent and keep creating and destroying widgets i just show or hide them .
So in this example let’s say I’m on the login menu and I click register to go to the registration widget . Simply create a variable reference to each widget and then use the set visibility node . Also you can tidy all this away into functions that you can call from other places . It’s easier and causes less problems
- create a widget called Menu Button
- let that access what ever has created the main widget switcher
- add a int that is exposed in the Menu Button widget
- when ever you add Menu Button to a widget in the widget switcher it can switch to what ever state :3 here is a few pictures
Player Controller Handles The Widget
The Widget Swither Handles all the widgets
The Widget Button has Access to the Player Controller And Widget Swither
When you place the widget button in the widget it can switch to any index in the widget switcher
if that makes sense :3
Thanks for the answers guys! I managed to figure it all out now.