User Guide

In this guide I will explain how to use the Turret so you can customise it for your game

This guide will help you once you have **migrated** the files into your project.

## Setup

This section will tell you how to customise you turret. It will show you a list of properties and explain how to use them. The UnrealAutoTurret gives the user much control over the turret, because of this many of the properties can negatively effect each other. If you experience any problems make sure you read what each property does as the guide will highlight potential conflicts with other properties.

Firstly, drag and drop the Turret\_BP into your map by finding it in Content / Blueprints > Turret\_BP

Click on it to find all the properties in the Details panel:

Here you can see the **Static Mesh** and **Materials** options, these can be changes in the blueprints too. More importantly is the properties in Setup and its sub-categories **Projectile** and **Scanning**. Hovering the mouse over the property will give you more information, but here they all are explained in more detail:

**Setup** - general turret settings

* **Target Classes** - Add Classes from the project here and the Turret will find them in the map on start.
* **Target Exceptions** - Add Actors from the current map so the turret will ignore these as potential targets, this overrides the Target Classes.
* **Using Cone Of Sight** - If true then the Turret will use the attached cone (in Blueprints) as a collision component to take in valid targets. you can change the size and shape of the cone in Blueprints.
* **Target Tag Name** - The name here will tell the turret what tag name to look for on all Actors in the map if using the Using Tag List property.
* **Using Class List** - If true then the Turret will use the Target Classes as potential targets.
* **Using Tag List** - If true then the Turret will find Actors in the map with the Target Tag Name and use them as potential targets.
* **Is Instant Hit** - If true then then the turret will use ray traces to hit the target. If it is false the turret will spawn Whatever class has been selected by the user. The selection can be made under "Projectile To Spawn" drop down.
* **Shots Per Second** - How many times a second the Turret will fire projectiles
* **Max View Distance** - How close a target must be to the Turret it order for the Turret to consider it a potential target. Make sure this distance is as long or longer than the sight cone is Using Cone Of Sight is true.
* **Turret Pitch Accuracy** - Degrees of inaccuracy applied to the pitch of the turret. 0 is dead accurate, 90 is between 0 and 90 degrees.
* **Turret Yaw Accuracy** - Degrees of inaccuracy applied to the yaw of the turret. 0 is dead accurate, 90 is between 0 and 90 degrees.
* **Using High Arch** - if true then the turret will try and calculate the high arch of its arched trajectory. Make sure you have enough Projectile speed and movement range on the Turret in order for it to meet the high arch. See this and this picture for more information
* **Gravity Override** - The amount of gravity to account for in you aim. 0 is full gravity and 1 is no gravity. If Is Instant Hit is true then make sure to set this to 1. You can also turn off gravity on the AutoTurretProjectile\_BP if you wish to use a physical projectile and not account for gravity. If you are using gravity make sure to give your projectiles enough speed in order to reach the turrets Max View Distance otherwise the Turret will encounter errors.
* **Laser Length** - Sets the length of the laser sight.

**Projectile** - governs projectile settings

* **Projectile Speed** - The velocity the projectile will spawn at. See Gravity Override for more.
* **Projectile Count** - The number of projectiles that will spawn on Fire function. It is not recommended to go over 200 physical projectiles.

**Scanning** - governs scanning settings

* **Default Scan Direction** - C++ ONLY
* **Scan Max** - The maximum angle in degrees the turret will scan clockwise from zero. Cannot be more than Max Rotation Degrees in the Rotator properties if Is Turret Rotation Clamped is true, see more below.
* **Scan Min** - The maximum angle in degrees the turret will scan counter-clockwise from zero. Cannot be more than Min Rotation Degrees in the Rotator properties if Is Turret Rotation Clamped is true, see more below.
* **Scan Height** - The default angle in which the Turret will scan. + is up, - is down. Cannot be more than Max Elevation Degrees or less than Min Elevation Degrees in the Barrel properties if Is Turret Barrel Clamped is true.
* **Scan Speed** - C++ ONLY - not yet initialised.

There are a few more options as well. Clicking on the Turret\_Bp and then on the AutoTurretRotator (Inherited) as show in the picture below will bring up more options in the Setup drop down:

   **Setup**

* **Max Degrees Per Second** - This is the speed in degrees per second the Turret will turn when tracking a target.
* **Scanning Degrees Per Second** - This is the speed in degrees per second the Turret will turn when scanning.
* **Min Rotation Degrees** - If Is Turret Rotation Clamped is true then this is the maximum degrees the turret will be able to move counter-clockwise.
* **Max Rotation Degrees** - If Is Turret Rotation Clamped is true then this is the maximum degrees the turret will be able to move clockwise.
* **Is Turret Rotation Clamped** - If true then the turret Rotator range is set to Min and Max Rotation Degrees above.

Clicking on the AutoTurretBarrel (Inherited) will allow the user to change the Turret Barrel settings, these are similar to the Rotator but in the Turrets yaw. Hovereing over the properties will explain more.

## Blueprint

Open the Turrets Blueprint by going to - Content / Blueprints > Turret\_BP

The only thing you may need to change here is the sound. It can be found in the bright blue comment box at the end of the AutoFire Function:

Click the drop down bar highlight in red above to select an appropriate sound file (not included)

You are now ready to use the turret - enjoy.