Overview

image.png

The Animal AI system is a simple AI behavior for the animals. It works like a state machine having different states for each animal like Idle, Walk, Sleep and more.

Dependencies

The animal AI system depends on the Unity AI Navigation Package that you can add to your project by going to ”Window>PackageManager>UnityRegistry” and search for “AI Navigation”.

After you have added the package, you will need to set up two agent types, one for the animals and one for the monsters. So:

  1. Go to “Window>AI>Navigation”
  2. Add one Agent Type called “Animal”
  3. Add one Agent Type called “Monster”

Here are the settings we used for the agents:

image.png

image.png

How to use

Simple Use

  1. Drag and drop one of the animal prefabs into the scene.
  2. Drag and drop the “PF_Animals_Navmesh” prefab located in the same folder as the animals prefabs into the scene.
  3. Adjust the bounds of the navmesh to cover the area you want your animals to walk on.