Beginner UI question

I have a a Main Menu, General Equipment Menu and a Specific Equipment Menu. Most of what I need is in the General Equipment Menu. I have a back button that works properly to go back to the Main Menu. I have a button to bring up the Specific Equipment Menu. I need a button to get rid of the Specific Equipment Menu that is in the General Equipment. I’ve tried to reference it in a Remove from parent, but that’s not working. I’ve made it work with a remove all but that seems drastic and not realistic for future scenarios.

Sorry for the very basic question, but I can’t find a good answer anywhere else. Thank you for you time.

this is not the way. you should make this everything in one widget. then it is simple, hide it.

There are multiple ways to do but here are two:

  1. Have all 3 inside a single Widget and use a Widget Switcher to switch between them
  2. Give a reference to all 3 and when you press the back button you can either change the visibility to hidden/collapsed or simply remove them form parent

From the code you are showing, when “Button5” it is pressed it is creating the widget “Class Menu”, adding it to the viewport and then it is removing the widget that contains the button. If “Button5” would have been inside “Specific Equipment Menu” then that widget would have been removed. But in your case, that button will remove “Archer_Menu” as that is the self reference.

That helped, thank you.