Getting Reference To The Widget

Hello,
Id like to make a Reference to the Widget so I can “Bind Event” from that Widget. Any suggestions how I could get reference to that Widget, without using “AddComponent->Widget” or “Create Widget(cant add it to Viewport)”
Thank you :slight_smile:

This?
image

1 Like

Yes I need Return Value so I could, like you can see it up there, Bind Evenet to…

That’s “Create Widget” node. You can get ref form it.

1 Like

Its in VR so i cant add it to viewport to fire it. Ive tried like in the picture (with Create Widget) but never gets casted.

You can make 3D widget.

1 Like

Watched it :sweat_smile:, huh, how can I explain it. Its like already made programm im just making tutorial for it, so im not allowed to change code, cuz the widget i need is already connected to other widgets, and is later used in “radial menu”, so I cant recreate it or smth, Im looking for a way just to get a reference to it so i can just get called event, if it makes any sence

Ok, I’m guessing Widget is created in one BP, but you need to get it in other BP?

1 Like

Yup, its in separate Widget where also code for it is, and im making “monitoring actor”, to manage that conditions.

Well, all I can recommend is Get All Widgets of Class.

1 Like


U mean like this?

Do you have more then one of them? The widgets?

1 Like

Like 15(Subwidgetsm and they r connected to the radial menu), but i needed for this one because most of them were used and called somewhere in actor on other way so i was able to get it easy. But Ive found the mistake:


Just had to connect “Compleated” with “Bind Event”, so as it founds it can just go for an event. Instead

ForEach->Cast->Bind :x:

ForEach->Cast Compleated->BindEvent :white_check_mark:

Um, that isn’t really a solution.
What it does is just gets last widget.
If it helps, sure. But beware, it can cause problems in the future.

1 Like

Ah ok, didnt rly knew that. I thought about comparing with == objects, so i can make variable refering to that widget and == with it and then cast to it, but idk if it makes sence?

You need to Identify needed widget. Does it have some ID, like index, tag or name? That will tell you it’s 100% widget you need.

1 Like


Here’s solution :slight_smile:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.