Can't communicate with parent of child blueprint from another blueprint.

If BPA contains a child of type BPB, then to get to that blueprint’s events, we need

Yes, read it a weep. Inheritance works just fine, but child actor blueprints are best avoided…

PS: you drag a pin from the child actor reference and look for ‘get child actor’.

PPS: The concept of inheritance is not applicable here. That applies when you right click a blueprint in the content browser and choose ‘make child blueprint’. Then you get all the events and functions passed down.

The situation we have here, is not really parent / child, it’s a child actor blueprint component, inside a blueprint.

I’ve been trying to figure this out for 2 days and nothing works. I started with a big blueprint in my game but now I’ve coded a small example of the problem. I have a table with a candle on it that can either be lit or unlit. I have a light parent blueprint and the candle is the child of it. The table is the main blueprint and looks like this:


So, there are events in the parent blueprint for the candle. At first I thought that I could just call those functions inside the table blueprint, but they don’t even show up there, even though I have a refernce to the child. Why can’t I execute an event in the child’s parent from the table blueprint? Are those events not inherited by the child? That doesn’t make sense to me. So, I thought, I’ll just do an interface to do this. I did that and I do have references to the interface functions in the table blueprint and I can code it all up but when I run it, it doesn’t call the parent interface functions at all. So, I guess I have 2 problems that are similar. 1)Why don’t the parent events/functions show up in the table blueprint? 2)Why, when I call the interface events do they not execute in the parent blueprint? This seems so simple and common but I can’t make it work… frustrated!

Thank you so much for your reply! I didn’t think to do the cast but I wouldn’t have thought that I’d need to ‘get child actor’. That works just fine for events/functions. Why do the interface functions not work? I’m just trying to get a handle on this.

I did end up using a BPI with a similar setup, just because of the horrendous code above. For sure, it works.

The thing to consider with BPIs, is they can be called on ANY actor, no matter what type it is. Even if the actor doesn’t implement the interface.

If you can show your code for that I’ll take a quick look.

EDIT: There’s no need to BPIs here, it’s solely to cut down on code! :slight_smile:

If you’re not planning on doing this:

A direct ref can be setup on Begin Play. If you swap classes around, an Interface is a must.

Even if the actor doesn’t implement
the interface.

I got blindsided by this once. Such function will still be called and will return (the defaults). Worth taking a mental note.