Getting "Root" parent reference

Hi I am trying to get a reference to the “Root” blueprint from a child/grand child/great grand child blueprint attached actor.

Example

(RootObject)---------(Child-BP)----------------(GrandChild-BP)---------------(GreatGrandChild-BP)

I want (GreatGrandChild-BP) blueprint to find out what the (RootObject) blueprint is, these parent child relationships change so I cant just create a reference at the start. So far I have tried Get Owner and tried to update some text to see if it can see the root object at all.

But this just returns a None value, I have tried this method to grab the tag of the owner but no luck there either.

Am I using this wrong or is there some other way?

Thanks.

What are you trying to achieve here?

The parent child relationship makes it so you can reuse code from one blueprint to another. If you have a root blueprint, then create a child blueprint and a child of that one and so on, if you spawn the last one on that chain, you are not creating one blueprint of each step on that ladder, so it is not like you can ‘‘find out’’ what the root object is, you already are the root object and an object can know everything about itself. Maybe I didn’t understand what you were trying to say

Edit: With that question I’m trying to ask what kind of game are you making what is the purpose? why are you doing things like that? Just so I can understand the problem better

Consider a Tank, with a Turret. On top of the turret there is a Machine-gun.

Each actor above could be a child of the next, the Turret - a child of the main hull and the machine-gun a child of the turret.

In the context of the author’s question, the machine-gun would be the GrandChild-BP. I can see there might be use in having a quick way to determine a reference to the hull.

Oh I see. I had the OOP concept in mind instead. Then I would say he should just create a reference variable on the children that points to the parent, setting it when they are created.

Yep, that’s what I’ve done on my implementation but I was hoping someone knew of a more straight-forward solution.

Thanks guys, I ended up using this in my root object

I will probably change it to a variable being passed up from the root blueprint like MacDX said so I don’t have to wait for the trigger event above to execute for it to be up to date on its children.

Thanks

yeah but how does one call a function of the rootobject from the grandchild ?