Automatic Unit or Building setup
You’re able to setup units semi-automatically. It can be done using Units Editor window. Open this window by clicking top menu -> RTS Starter Kit -> Units Editor:

In the opened window select the needed unit (if you need to create a new unit, click Create new unit button. You can also clone another unit by selecting it and clicking the Clone button). Setup all parameters as you need, and don’t forget to fill Unit Model field by model of your unit from assets:

Finally, you need to click the Generate unit prefab button in the right part of the window. After click, the created unit prefab will be spawned on scene and saved in Prefabs/Units folder. A lot of it’s settings will be automatically configured, but there still some params, which you should setup manually:
Parameter |
Description |
---|---|
Unit colored renderers |
parts of the unit, which shows its house (player) color (read next partitions for more info). |
Collider size |
physical size of the your unit. Used for bullets hits calculations mainly. |
Fog of War module parameters |
imported automatically, but can require manual tune. This is renderers/gameobjects of unit which should be hidden when unit moves into fog of war. |
Other settings can be adjusted manually too, if you want.
Using bones for auto-setup
Important thing is the auto setup of the model and bones.
First, your model will be rotated properly only if it’s pivot is right for Unity (Z-axis is forward axis of your unit model).
Second, you can add several bones (empty objects or model parts) to your model, which will speed up the setup of the unit. Their name should start from the special prefix. These prefixes listed below:
Bone prefix |
Description |
---|---|
rts_wheel_ |
if a unit has wheels, name it’s bones like this, it will be automatically used by scripts. |
rts_shoot_ |
points, from which will shooted bullets by unit. In most cases you need only one shootpoint. |
rts_turret_ |
if your unit has a turret, you need to name its bone like this to allow scripts to automatically find object to rotate the turret to enemies. |
rts_spawn_point_ |
used only for production buildings. Means position, where will be spawned produced unit. |
rts_move_point_ |
used only for production buildings. Means position, where unit will try to move after it was builded by Production. |
You can find an example model of the unit in the project, just input in search ArtilleryReadyToAutoImport phrase.
You can don’t use these namings, but in this case you’ll need to setup all these parameters manually (read next partitions).
In future there will be added more bones variations for automatic setup.