In this chapter, we learned how to implement state machines in Unity3D based on a simple tank game. We first looked at how to implement FSM in the most direct way by using the switch statements. Then we studied how to use a framework to make the AI implementation easier to manage and extend.
In the next chapter, we will take a look at randomness and probability, and see how we can use it to make the outcome of our games more unpredictable.