How to force child blue prints to call parent methods?

I have a parent blueprint which sets up the static meshes with a certain material in the construction script and adds an event listener on begin play.
Now I have several levels, and in each level there is a blueprint which uses the parent blueprint as its parent. It is mandatory that each child blueprint executes the steps described above, i.e. that it calls the parent construction script and the parent begin play event. Rather than having to call these methods manually for every child, I want to force the children to call the parent methods, no matter what. How would I achieve this?

The children don’t need to expose the parent calling to anyone btw., but if they do I’m fine with it, as long as I don’t have to set it up manually everytime and as long as the children can’t just delete the call to the parents.

this “right click → select ‘Call Parent Method’” is what I mean by manually. and yes, I want the child node to have the parent’s event node present from the start. other people may add new children over which i don’t have any control, but these children need to execute the steps from the parent, otherwise the application won’t work properly

2 Likes

What do you mean manually versus automatically? I’m picturing right-clicking the event in the child bluprint and selecting the “Call Parent Method” option (I think that’s what it’s called) which gives you an orange function node that calls the parent class’ method. If that’s what you mean by “manually”, I don’t know any other way to do it, but I’m probably the wrong person to ask since I haven’t used inheritance beyond creating classes from the built-in classes.

So what I do is I let the child class’ event call the parent class’ event function. Are you saying you want the child class to not have to do that and just HAVE the parent event node already there and start from that? I don’t know how to do that.

Not sure if it can be done in blueprint without adding that ability with C++
Hopefully it can!

I haven’t tried this yet but can it be done by getting it from the Overridden functions list?

I have looked arround a bit, but I couldn’t find an “Overridden functions list”. Is this callable from the parent? And even if so, how would you go about it?

I mean in the left sidebar of the blueprint editor window there’s a list of functions that you’ve defined, and at the top of that pane, it says x number of functions, y number overridden. If you click that spot it drops down with a list of inherited functions you can override. I wonder if the events you need to override are in there?

Oh, right, sorry. Still new to this.
It says “Overridable” though, so it doesn’t say which of its functions are actually overriden. So far I haven’t found the option that makes a function non-overridable, but I don’t know about all of the tools I have.

It’s simple
Instead of creating the new child through the parent, create the new child by copying another child. I leave a child that I call “base_child” just for this. It did not have any changes in relation to the parent, but I make sure that all calls to the parent’s methods are set. So every time I want to create a new child I make a copy of the “base_child” instead of creating it from the parent.