PlayerProjectile: Creating more child Blueprints
We are going to create two more types of projectiles that can be used by the player. They will also be implemented as child Blueprints of the PlayerProjectile C++ class.
We will make a copy of the Blueprint of the first type of projectile to take advantage of the configuration made in it.
In the Content Browser, access the FirstPersonBP/Blueprints folder and right-click on the Blueprint BP_PlayerProjectile1. Select the Duplicate option as shown in the image below and write the name BP_PlayerProjectile2 for the new Blueprint.
Click on the StaticMesh component on the Components tab. The StaticMesh properties will be displayed on the Details tab. Let’s change the shape of the projectile. Select Shape_Pipe for Static Mesh and M_Metal_Copper for Material. In Rotation put 90.0 in Z and change the Scale to 0.5 in X, Y and Z.
Click on the ProjectileMovement component on the Components tab. In the Details tab, change the values for Initial Speed and Max Speed to 6000. This will double the speed of this projectile.
In the ProjectileMovement properties, change the Projectile Gravity Scale to 3.0.
In the Blueprint Event Graph, modify the Event Hit to have the actions shown in the image below. In the SpawnActor action, select the Blueprint Effect Explosion in the Class parameter. Right-click the Spawn Transform parameter and select the Split Struct Pin option. Change the Spawn Transform Scale to 5.0 on X, Y and Z.
Compile and save the Blueprint. We have completed the implementation of the PlayerProjectile and its child Blueprints. In the next article, we will start to implement the PlayerCharacter that will use the PlayerProjectile.