Computer controlled characters (non-player characters) often need to seek and move towards another object (such as the player's character), or alternatively flee away from another character. The logic is the same for both seeking and fleeing, and is demonstrated in this recipe.
This recipe builds upon the player-controlled cube Unity project you created in the first recipe. So make a copy of that project, open it, and then follow the steps of this recipe.
To make an object seek, flee, or follow another object, perform the following steps:
Arrow, positioned at (2, 0.5, 2) and with scale (1, 1, 1).