Example brain: Sheep

This is an example of a sheep that wanders around, randomly stopping to play an eat animation and make a bah sound. The state called Start is where the Sheep brain state machine starts when the sheep is activated. In this state there is an action that sets the destination of the sheep to a random location a random distance away from the sheep's starting location using the Set Target action. The AI will use pathfinding to go around any obstacles it needs to to get to its destination. The [Always] connection changes the state to the MoveToTarget state. While in the MoveToTarget state it runs Move to Target action each frame until it reaches the target destination set by Set Target action. Once at the location it moves to the Eat state. This calls the Set Timer action which sets a timer on the Sheep for 5-10 seconds, plays an eating animation using the Play Animation action, and plays a bah sound using the Play Sound action. It immediately moves to the Waiting state where it waits for the timer to be finished using a Check timer requirement and then goes back to the initial state to choose another random target to go to.