How do i remove a widget from the viewport

When i try and use the remove from parent like some other answers on some other questions said it didn’t work for me…

same for me UE4.8!!! any help pls?

It’s Simple!
In any blueprint use “Remove From Parent”. If you’re using something outside the widget blueprint, you need to say wich Widget by using a var or picking up the output of the Create Widget Event.

5 Likes

UE-4.8

I have added buttons in my BP-MainMenu blueprintClass and wanna load this in the Level Blueprint Level-00 Event BeginPlay.
When Play button is clicked i wanna start Level-00 and remove this widget from the viewport, but remove is not working…

Im not using something outside of the widget blueprint…

Thanks for advanced…

MainMenu

1 Like

I think the Event BeginPlay is called each time when level start and create the widget also. so when the play button clicked > level start > widget create again and again…
this is an infinite loop… :stuck_out_tongue:

Finally got it… :wink:

erm…so may i asked how you to solve the problem?I have the same problem with that…

1 Like

Use remove all widgets?

Just use “remove from parent” in the widget blueprint event graph and target is self, thats it…

Or… you can use “remove from parent” from any blueprint, u just need to add widget blueprint reference as target.

2 Likes

That doesnt work for me…

If it is infinitely stuck in adding the widget for some reason, then put a “DoOnce” node in front of the Create Widget node.

1 Like

Yep, does not work for me either, even when loading the play level not the menu level it overlays the menu.

4.10

For me it helped to check the “Is Volatile” at the button. Nothing helped untill I checked it.

Im using 4.13 and this problem still persist.

Is there a bug to the new “Remove From Parent”? It adds “Widget to Viewport” and works 100 percent. However “Remove From Parent” worked only on rare occasions and then it doesn’t work anymore. “Remove All Widgets” which worked 100 percent and its awesome, however more often than not, we do not want to remove all Widget.

I tried adding it in other blueprints or in the widget blueprint itself, both couldn’t remove the widget from viewport. Is there a set up that we should be notified of?

Got it to work :slight_smile: simple

I just skipped Open Level.

1 Like

I wanna share my stupid mistake.

I created the widget mistakenly within the for each loop node stream.

So even if I removed a widget, there were still 7 siblings sit on the screen comfortably watching me going nuts.

I hope this confession would help dumb cuties like me.

2 Likes

Had the same issue. I’m glad it was spotted.

lol wait, so your solution is to remove open level, the whole problem is that the widget isn’t removed when you open a new level, so how the [redacted] is this even helpful?

I fixed this issue by changing the World Settings for each Level.
I have on button click>remove from parent(self)>Open Level. Similar to Hanif shows, but without get Player controller.
I had Main Menu Level and Battle Screen as their own Level and each had their own HUD widget.

(Anything shown as “name” is what mine is called. Yours is what you named your Levels, HUD, etc)

Open the “Main Menu Level” (or whatever your first level you want shown is called) under Maps folder
Look under Game Mode. Make sure your game mode override is “Main Menu Level”
Make sure your HUD class is “HUD_Main Menu”
Open the Second Level you want to Open. Mine was “Battle Screen”
Check that the Game mode is “Battle Screen” and that the HUD Class is “HUD_BattleScreen”

This will break the infinite loop when opening the new level.

So I realize this post is super old, but I recently ran into this same issue and found a solution, so figured I’d share. I had to use “Get All Widgets Of Class” → “Remove From Parent”.

PLEASE NOTE : If you have more than one widget of the same class in the parent, and you don’t want to remove ALL of them, this is NOT the solution for you!

259736-widgetremoval.png

14 Likes

For people for which the Remove from parent didn’t help:
DestroyComponent fixed it for me.

1 Like