My menu isn't removing with any nodes

I wanted the widget menu to be removed when pressing a button. I’ve tried ‘remove from parent’ and ‘remove all widgets’ nodes. I checked the level blueprint for any other ‘view to viewport’ nodes and none but one for to create said widgets. Whenever I set the button to open another level, it will load; but the current level that I wanted to open, it doesn’t work. I’m not sure whether to rename the level to something else? Is the level overlapping multiple times? And if so, how do you fix that? I feel like I tried everything and I’m not sure what to do? Any help is very appreciated!!

Hello @ybenjamin0 ,
Could you show where you’re creating the widget and how you’re trying to remove it inside the Widget ? That would make it easier to see what might be causing the issue.
I’ll be waiting for your reply!

I’m creating the widget blueprint to view in the level blueprint.

here’s the photo:

And im trying to remove the widget after clicking a button in the Level Widget Blueprint:

here’s the photo:

Again this weirdly works when the ‘open level node’ is set to another level but the current one that I actually want it to remove. :person_shrugging:

What’s happening is that you’re creating the widget in the Level Blueprint. Then, when you press the button, you remove it, but immediately after that you reload the same level. This causes the Level Blueprint to run again, which automatically recreates the widget.

That’s why it looks like it never disappears. On the other hand, when you open a different level, it works correctly because that new level is not recreating the same widget.

The key question here is: what do you want to use this widget for?
Is it a menu, or something that should always be on screen, like a health bar or HUD?

I also recommend avoiding creating widgets in the Level Blueprint, except for quick testing. In a more solid architecture:

  • The most common approach is to create them in the Player Controller, since it gives you better control over UI during gameplay.
  • In other cases, such as loading screens, global systems, or login flows, they are usually handled in the Game Instance.

Moving this logic there will help you avoid these kinds of issues and give you a much more controlled workflow.

I created a parent widget to hold other two widgets (and for future widget menus): the main menu and the level select menu; that’s why it’s named HUD Parent Widget WB (i accidently named it with HUD in it). I heard that it’s the proper way to show functionally widgets so it can be easier to call in a widget index in other widget blueprints. Is that true? Im going to try this fix tomorrow and ill let you know when its fixed

I created the same blueprint into the player character bp and it was having the same issue. I also created the same inside the controller and nothing happened. Here is an image of the code in the player character blueprint:

Does it have to work only inside the controller? If so, I’ll see what could be the issue of why

or can it be referenced from the create widget node to the ‘get player controller’ node in owing player?