Widget Switch

Hello everyone, hopefully someone can help me with this widget problem, the thing is I created a simple widget switcher that goes back to the previous widgets I’ve been using it in other parts of my game but for some reason it won’t work with my pause menu and main menu it has to do with my settings widget which I can access through the main menu and pause menu but whenever I try going back from either it just clears the widget help would be really a appreciated.

Hello,

From what I can gather from the screenshot, it looks like your reference value is not valid (error message?). So it most likely fails on Is Valid check, if not it fails on a 2nd cast node. I suggest adding a print string to all possible function exits together with return node.
So basically you remove current widget and everything else after that fails (not valid / cast failed). So my assumption is that Previous Widget variable is empty.

What you can do is

  1. use a widget switcher to switch between widgets
  2. pass over reference of current widget to the one you are switching to before you add it to viewport
  3. use a centralized place to manage your widgets, have them all created and switch between them by changing their visibility settings

I leave it to you, which direction you want to go. Perhaps there are other ways to deal with this, but that is all I could think of right now.

Below a short video by Mathew Wadstein on Widget Switcher.
HTF do I? Use the Widget Switcher in UMG (YouTube)

1 Like

Yes, you are correct about that the reference is empty, I did also try doing the widget switcher thing before, but I got all mixed up to how I handle my widgets also I must note that the only reason why I did it this way is because I wanted to just press back on my controller and it would bring me to whichever one I came from