Download

Parent Blueprints - What's inherited?

Hey,

I was a bit curious as to what’s inherited and overwritten when it comes to having Parent Blueprints.

For example, I have two different types of projectiles and I figured I’d make a base-class that has some basic behaviour I want across all my projectiles, but with different settings, such as life duration, etc.

  • BASE
    – Proj1
    – Proj2

Question 1:
If I have a Begin Game event in my parent, will that be overwritten by the child, or will they both run?

Q2:
If I make use of a named variable in the parent. E.g. a float and I set up a BP-flow using it in the parent: If I then simply add the same named variable in the child, will it run the parents flow but the childs value? (I’m guessing no, but that’d be cool.)

Q3: My Proj1 has a ProjectileMovementComponent but when I set BASE as the parent it no longer works. (The base does not have one.) Any clear but answer on why that is?
Edit - added:
Without the parent, I have an arrow as parent:

https://dl.dropboxusercontent.com/u/206884/ue4/parent_proj01.JPG

When I add the parent, it adds a scene-point:

https://dl.dropboxusercontent.com/u/206884/ue4/parent_proj02.JPG

But then I get the following error:

https://dl.dropboxusercontent.com/u/206884/ue4/parent_proj03.JPG

Thanks,

Hi Arcade,

All variables and functions you create in your parent class can be inherited in your child classes. Although i think you can only override variables and not functions…Am not sure on that.

Thats the same workflow am using for my Infinte/Runner example game. I created a parent pickup class and created all other child pickups from that one. I created variables in parent class and modify them in child classes.

If you create a Begin Game event in your parent class and you create child BP’s from it you still need to Call Parent function.

Example:

Simply adding a variable in your child class does nothing. If you have a Event or a function in your parent class that make use of that variable, you need to call it first and then you can access its value.

For your 3rd question am sure someone else might answer as i havent tried Projectiles yet.

Ooh! Mucho thanko for that ryanjon2040!

Happy to help. Enjoy Unreal Engine 4. :slight_smile:

Ah! I solved the parent projectile issue with:

https://dl.dropboxusercontent.com/u/206884/ue4/parent_proj04.JPG

Don’t forget that the construction script is also a function, so if you do anything in the parent construction script graph that you want the child to do, you’ll want to add ‘add call to parent function’ call there as well.

Cheers,
Michael Noland

Yup!
But that seems to be added automatically. :slight_smile: