/StateMachineAI

Demo of a simple AI that uses a state machine and waypoints in Unity

Primary LanguageC#MIT LicenseMIT

StateMachineAI

WebGL build at https://jhocking.itch.io/state-machine-ai

This is a demo of a simple AI that uses a state machine and waypoints. Arrow keys move the player, while the enemy behavior is:

  • slowly patrol waypoint path until see player
  • brief pause for guard noticing player, then give chase
  • if the player goes around a corner just move to last place seen
  • once reach that target check if can see player now
  • if not then pause (maybe look around) before returning to patrol
  • navmesh back to path, with obstacle avoidance at all times

resources for first pass:

later improvements: