In order to give variety to our game, this section explores an alternative to the previous enemy controller. Once again, this shows how to create challenging enemies with just a few lines of code, without complex AI algorithms that can be confusing for beginners.
Alternative enemy controller
Creating the second enemy controller
To create the second enemy controller, we can start by duplicating the enemy controller; just select it and press Ctrl + D (if you are a Mac user, you need to press Command + D). The new script should be renamed EnemyControllerSmartAttacker.
Double-click to open it, and change the class name to EnemyControllerSmartAttacker, like the following:
// [...] public class EnemyControllerSmartAttacker : MonoBehaviour...