Remove from viewport... remove from parent???

I come to an understanding that remove from viewport has been changed to remove from parent in 4.6. But currently i’m having trouble getting the widget off my viewport as of 4.7.
The current settings i have is to use the start button on the gamepad to pause the game and bring up the menu. I am able to un-pause the game by pressing the start button again but the widget menu remains on the viewport as the game kept going.
How do i fix this?

The start button function has been set on the level blueprint and widget is the widget blueprint. For additional note, the widget is set on another level but uses the widget blueprint just to be clear. Is this the source of the problem?
Thanks in advance.

addd356e257eeeb3616180c7273f0a64cad9255c.jpeg
5097edb977564314d346e8b6ac268b9791f5f539.jpeg

Hello,
When you use the node “create widget” you create a new widget. And this is the one you remove when you “remove from parent”, why the first one is always here. You need to create a variable reference of your widget when you create it and use this to link to “target” input of “remove from parent”

Thanks for your reply. Sorry but i’m kind of new to this but i made a variable and stated it as user widget. How do i define the user widget to be the widget as i’m using as i have more than 1 in the scene? Or should i use other type of variable?

You can also just “GetWidgetsOfClass” … do a “ForLoop” … remove the item returned by the “ForLoop”.

1 Like

It works!! Thank you soooo much!!! Been scratching my head for 2 days straight!

1 Like

This is out of topic but how do i define an object in scene in a widget blueprint?

Rather create a new thread, this allows people to find solutions and learn along with you at the same time.

Ok thank you. I’ll post it after taking the necessary screenshots.

Using “get all widgets” of a type will be fine as long as you have only one widget of the same type. If you have more then all the widgets will be remove. The solution is as i said to drag a wire from the return value of the create widget, and do “promote to variable” Name this variable to a name related to the blueprint and use it to add to viewxport or remove from parent.

@Fen I know this was 4 years ago in regards to this thread. But I am trying to remove created widget after pressing the same key. However, all it does is keep creating more widgets ontop of the first. I setup a ‘onclicked’ remove parent and showed the cursor to allow it to be closed with a click. That works. I want it to work with pressing the same key to remove from parent. Please help?

I realize the QuestLogClient events are redundant for what I am trying to do. I have since removed them. However, still having the above issue.

Where do you **Set **Quest Log UI variable? Perhaps the var is always invalid. Set it after / before adding it to the viewport. Also, you create it at the very top just to remove it…

I figured it out. Thanks tough @Everynone

I know this is a very old thread, but looking for answers I found it, and I think I used the same logic as you describe here, but in my case it doesn’t work. Granted, this 7 years after this post, and I’m using 4.23, so this may have very well worked in your version but changed over time.

The thing is, this logic doesn’t work for me. So if anyone could tell me how to do this right, I would really appreciate it. This is my blueprint:

The goal is to have a “splash screen” with an OK button, that when pressed, takes the user into the main and only level. I always had trouble with the “remove from parent” node, I was never able to use it without getting errors.

i had the same problem on 5.1