UMG multi-pages (sub menus) menu

Hi Guys

I’m trying to make multi-pages menu i.e. imagine you have: play, options , exit, back buttons …now if I click on the options i need to have another page with all available options.

What is the logic behind to create such menus with UMG.
I just need some pointers.

I’m working only in blueprints.

Any help is greatly appreciated.
Thanks

I’ve been creating each individual Menu in its own blueprint and as I navigate through them, I load and unload them as needed.

So let’s say you have a Main Menu with Play, Options and Etc …

Your Main Menu UMG would have buttons for Play, Options, etc with their OnClick Removing Menu from Viewport and Creating the respective new UMG widget and adding it to the viewport.

You could, if you wanted to, just add the new UMG widget to the current viewport and just remove it from parent when clicking a back button.

Hi Justin

Thank you for your answer…It worked !

Regards
THX2000

EDIT: Since my question includes a different approach I have created a new post, sorry about the mess:

Hello Justin! Wherever I look for an UMG answer, I see your name and I do appreciate your help!

I am having trouble about public variables with this method. I have 4 pages for different rooms. In each page there are buttons that change the materials of different Static Mesh Actors. When I get a different page and turn back to first, all variables are gone thus I cannot change any materials anymore until I trigger the menu again. By the way, I used the same logic you explaind changing materials from UMG buttons, just had to implement it to Level BP. How can I fix this issue?

It seems after creating the widget and just before adding them to viewport applying the actors to variables is the problem. When I remove the widget, it removes the variables too. Do you have any idea about more ways to do this? Only thing I have in my mind is messing with z-orders. Like setting unused ones to 0 and the active to 1 so without destroying the variables it seems it is possible to switch through different menus

I was supposed to finish this project with simple wall and floor material changes, but my professor loves pushing my limits. I am doomed!

Anyway, thank you so much again!

You could, if you wanted to, just add
the new UMG widget to the current
viewport and just remove it from
parent when clicking a back button.

After pressing back and removing the new widget from parent, how do you know what type of widget to recreate to get back to the original menu? You could have arrived at this menu from the main menu, in game menu, or other menu.

Create a ‘Master Menu’ widget which has a Widget Switcher in it. In the widget switcher put all your other menus. Each button press should reference the master menu to switch widgets. You can even put a widget switcher in one of the sub widgets for stuff like an options menu.

This is definitely the easiest way to go about it, without loading and removing widgets.

1 Like