Download

Bp Ineritance - Reference Object - From child to parent - low-top communication

Make a Bp and create a Bp child from it.

I am having an issue when I try to communicate an array from a child to parent by interface.

Basically I can’t get the proper reference of the Bp parent, needed in the target “field” interface.

Especially I fail to understand why, if I create a reference variable to self in the parent Bp, such reference its’nt not read by the child blueprint.

Infact I get this message from Ue4:

Blueprint Runtime Error: “Accessed None trying to read property parent” where “parent” is the reference to the self variable stored in the Bp parent.

Please someone could explain what I am doing wrong?

On the other end, if i use the node get all actor of class i get the right reference to the parent object and the interface works.

Am I missing something?

Thanks in advance

When you make a child from a parent in the content browser, you have not instanced any real blueprints. You have just made a definition of another sort of BP ( the child ), which is based on the parent.

Even when you have an actual parent and child in a level, ‘Self’ is always a reference to the local BP. It will be the child, in the child. The same for the parent.

You need a running instance of the parent in your level, then you have a ‘real’ parent. It can spawn a child BP. Now you have two running BPs.

Then you can reach the parent using ‘get parent actor’ inside the child.

@Lupoluke, Just so you know:

Let’s say you make a Blueprint Actor called BP_a, and a child class of the Blueprint called BP_b. When you spawn it in the world, the spawned Actor is a BP_a instance, and a BP_b instance. It’s called polymorphism. There is no “Parent object” and “Child object”. There’s just one object. So when you got a reference to the “Parent” object, you just got a reference to self. Why would you need to access the “Parent”, anyway? The child should carry over all variables and functions and all functionality.