Day 5

Artificial intelligence - Patrolling and way points As part of my game I decided to use wooden crates as way points. Each crate has a tag which is also defined in the script that marks them as way points for the AI character to walk past. The code below defines the base values for the script above but also acts as a core for the patrol state. Using the script in the animator In order to pump life into the AI characters in my game I used Animator to link the patrol node to my entity as seen in the picture below. The AI character will keep on running from one way point to another because there is no exit state attached to the "Entry" node. Patrolling in action