I’m just trying to do a simple menu-switching function bound to a button on the main menu that removes the current widget and creates the options menu widget and assigns it to the viewport. The back button on the options menu is set up exactly the same way, only when I set this one up, the button does dark in the editor. And when I try to play it, only the options menu appears without the ability to go back to the main menu.
I’ve double-checked that I’m calling the correct widgets in each “create widget” node btw.
So…I don’t know if is a UMG bug or whatever…but I create all UMG widget in Player blueprint and cast them via Player character > Cast to [your character]
Works for me and don’t forget to modify your Gamemode or it will not work!
Using the function Create Widget after Begin Play I promote every variable that return me the value of the function inside Mycharacter Blueprint.
Inside the Widget function…I use the Remove from Viewport just like you did…but when I need to add to viewport the new widget…I get the Player character…pull the blue node and Cast_to_Mycharacter…only then i can change HUD