Shouldn't parent class bp script actions trigger by default?

I made a parent class blueprint with some code, and then made a child blueprint, and as it turns out, the child blueprint won’t trigger actions of its parent if I don’t add a call to the parent’s functions, such as begin play, begin overlap, etc.

Shouldn’t this happen by default without having to manually add those calls? Now I’m a bit confused on what’s inherited from the parent class, and what’s not.

Everything is inherited from the parent class (excluding macros and access to private variables).

But whenever you override a function/event, that completely replaces the parent code. Overriding a function has to be done in an obvious way, but I can see where your confusion for events comes from.

Whenever you add an event node (ie begin play / begin overlap) to a child class, that completely replaces the parent’s version of that event.
If you have a parent class that prints Parent and a child class that prints Child, the only thing that will be printed is Child.

With nothing in the Child class, Parent will print.

With the begin play event doing nothing in the child class, nothing at all will print
image

With the child printing Child, Child will print
image

With the child calling the parent and then printing Child, first Parent will print and then Child will print
image

Having nothing is the same as having an event that just calls the parent:
image


Feel free to do some experiments to solidify this in your head- nothing teaches this better than trying it yourself. Though also feel free to ask any follow-up questions if you’re confused.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.