Download

How to get parent Blueprint a user widget is placed in?

I have user widgets inside user widgets.

If I run the following loop to get the top level parent, I only ever end up in a Canvas or Vertical Box of the current user widget:

How do you break out of the current user widget and access the actual parent blueprint?

Is that something other than “parent”, like “owner” or what keyword am I missing here?

I don’t believe that is a “thing”. Parent, as you’ve found, is just the widget that you’re contained within which may not be the blueprint that you care about.

A good question would be: Why do you feel you need to do this? Usually this is the sort of reference direction that should be avoided because it makes reusing widgets incredibly difficult if the widget walks up and tries to do something with the blueprint since it probably requires that to be a specific type to do what the widget wants to do.

Instead, I would recommend that you look at the Event Dispatchers. These allow you to establish events that other blueprints can bind to. So you would create a Dispatcher for your circumstance and instead of trying to find the outer blueprint, you’d just call the Dispatcher. In the outer blueprint you’d bind to that Dispatcher and do the work there.