In part 4 of this tutorial series we created the Moving Obstacle Actor and we learned Blueprint coding in more depth.
In this part of the tutorial we are going to learn about inheritance between Blueprints.
A Recap About Inheritance
Creating The Fire Ball Obstacle
In the preview of the game we saw that we have obstacles that serve like solid objects that are going to prevent us from passing and going to our goal, and we also have obstacles that deal damage to the Player when they touch him.
That obstacle is the fire obstacle.
Inside the Blueprints folder, Right Click -> Blueprint Class, but this time instead of inheriting one of the pre-built Blueprint classes, we are going to inherit the Obstacle blueprint that we created which is BP_MovingObstacle.
Inside the search bar filter for BP_MovingObstacle and select it:
Give the new Blueprint name BP_MovingObstacle_Fire, and now you will see two same looking Blueprints in your Blueprints folder:
The reason why they look the same is because the BP_MovingObstacle_Fire is inheriting the BP_MovingObstacle Blueprint and thus it also inherits all of its properties.
If we open the BP_MovingObstacle_Fire in the Blueprint editor you will see that it looks exactly the same as BP_MovingObstacle:
To change its appearance, we need to change the Static Mesh that we inherited from the Moving Obstacle.
Select the Mesh – Obstacle component in the Components tab:
And inside the Details tab for the Static Mesh settings, select the MaterialSphere as the mesh, and for the Materials settings select the M_Basic_Floor material:
Unreal Engine Particle System
You will see that you have two choices, one is Niagara Particle System and Particle System, select the Particle System and rename the component to Fire Particles.
To have the fire effect for the particles, select the Fire Particles component in the Components tab, and in the Details tab for the Particle settings, click on the drop down list for the Template and select the fire particle:
If you are wondering how do we have access to this fire particle template, it is located in the Starter Content -> Particles folder.
I am going to resize the Fire Particles component by changing the its scale in the Transform property.
First click the lock icon on the right side of the Scale and then set the Scale value to 3 on one of the axis and it will change it for all other axis as well:
Now you will have a larger fire circling around the Sphere Mesh for the Moving Fire Obstacle: