Download

simple start up menu back button troubles *urgent*

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. Capture6.PNG this is what i have so far and currently does not work. This is what i have for my main menu Capture47.PNG 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

c70f5ce7d5664f11b1048c741b2ce9ea.png

lol… just

  1. create a widget called Menu Button
  2. let that access what ever has created the main widget switcher
  3. add a int that is exposed in the Menu Button widget
  4. 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
player_controller of menu.png

The Widget Swither Handles all the widgets
widget_2.png

The Widget Button has Access to the Player Controller And Widget Swither
widget_5.png

When you place the widget button in the widget it can switch to any index in the widget switcher
widget 4.png

if that makes sense :3

Thanks for the answers guys! I managed to figure it all out now.