Defending with towers
The Defense Tower is a powerful unit that is placed as a building but can attack enemies that are within its range. This is great when defending the base while sending units to explore the map and is a must-have feature for any RTS game.
We are going to reuse many different scripts and GameObjects to add the Defense Tower as a new unit. This section also works as a guide in case you want to add different units to the game later.
Adding the Tower model
We need to import a new asset package from the Unity Asset Store to include a Tower 3D model and Prefab in our project. Go through the following instructions to add the Canon Tower package to your assets and view it in Package Manager so you can import it into the project:
- Open the link https://assetstore.unity.com/lists/creating-a-rts-game-5773122416647 (you might need to log in to your Unity Asset Store account created in Chapter 2).
- In the list of assets, find the one called Canon Tower and...