Summary
Well done on reaching the end of this chapter – it was one of the most challenging so far with many new features and concepts introduced, and a lot of code written. Our RTS game is getting bigger and full of great solid features that we are starting to put together to interact with each other. We are getting so close to having challenging and fun gameplay with many mechanics implemented.
In this chapter, we not only used systems developed in the previous chapters but also refactored and expanded the main scripts used by enemies and units, and, finally, we have a first version of the battle between them. Units can attack enemies with a melee or ranged attack, and, if the player chooses to flee, the enemies will chase down the units until one of the sides is defeated.
We also learned how to set up the physics settings in Unity and how to create a collision script that works nicely with the NavMesh system. Many new concepts and resources were introduced, such as the...