How to get a reference for a widget

For context, Im trying to make a inventory pop-up that disappears after one of the widgets is clicked
For example
I have two seperate widget blueprints, 1 of them has a button and one of them has a border (placeholder for item icon), how do i make it so that when the button is clicked it will remove the border from the player screen, i tried using the “remove from parent” but it only removes the button
Basically i need a reference of a widget and it dont know how
if possible i would like an image on how to because im an idiot but anything helps and thanks in advance.

When you create widgets (or spawn actors / components), you can reference them like so:

image

Think about where you do the above :point_up_2: and then where / when you need to access it. How to get there is circumstantial, though and it’s not even always necessary to create variables like this. Event Dispatchers, for example, are quite happy to work without them. But we’d need to know more.


two seperate widget blueprints […] inventory pop-up that disappears after one of the widgets is clicked

So:

  • the inventory, when clicked, creates a widget popup?
  • and adds it to what? viewport? or another container?
  • we click the popup and it goes away?

How close am I?

when the button is clicked it will remove the border from the player screen

Because this is quite unclear. We have an inventory, we have a pop-up and we also seem to have some kind of player screen border. How does it all work together? Consider listing a bunch of bullet points, describing what happens to whom from the player’s perspective. The more detail, the better.

2 Likes

I just followed the image and it worked, thanks and sorry for the lack of info, i still dont know what im doing but thanks for the help

1 Like