Method 1 - Child Blueprints
Here you will find out how to create child blueprints
Last updated
Here you will find out how to create child blueprints
Last updated
Right clicking BP_Turret reveals a drop down menu which contains "Create Child Blueprint Class". Click this button to create a child blueprint and name it as you wish, you can always check the parent of each blueprint by hovering over them in case of if you forget what parent a blueprint belongs to.
For this tutorial I will create a new Child Blueprint Class of BP_Turret for demonstration purposes, I will walk you through the steps to get it set up and running.
Inside your newly created child blueprint you will find the "Data" tab in the Class Defaults window.
Below you can see the Data struct on the right hand side of your window which contains all the configurable variables.
Note that you can still use a data table entry for child blueprints, ex. for quick testing The bottom four variables can be used to enable this.
This helps keeping it organized in-editor, the entire Data struct can be copied to another turret, useful for creating templates. Below I have named mine Minigun_04. The text in the viewport will update to match the name.
Let's start by adding a Base Mesh, this is the part that is static and doesn't rotate. Next we'll add the Yaw Mesh, this part rotates on the Yaw axis (Left and Right). Then we'll add the Pitch Mesh, this part rotates on the Pitch axis (Up and Down). Lastly we'll add the Roll Mesh, this part rotates on the Roll axis (optional since this will rotate independently if RotateBarrel is enabled, ex. Minigun) Image below is the result of what we just did. Notice how the Yaw/Pitch/Roll Mesh is facing backwards, this is due to the way these meshes are exported from the modeling software, this serves as a good example of how to adjust it in-editor rather than re-exporting it from modeling software.
We'll set Pivot_Yaw to
We'll set Pivot_Pitch to
Since the minigun doesn't quite fit, we'll set Mesh_Yaw's scale to
Lastly, we'll need to set Barrel_End's location, this one is most important, make sure nothing blocks this, the Arrow shows where the projectile spawns at and direction it is shot at.
When setup using the included meshes, you should end up with something like this
Make sure the collision mesh you use has correct simple collisions, this asset has a cone and sphere collision mesh included with preview material applied If the collision mesh is not setup properly, this includes collision channels on both the turret and your targets the turret won't be able to detect them inside.
This concludes the Blueprint Method of setting up a Turret. Visit the Configuration page to continue setting up the turret's behavior.