Skip to content
André edited this page Jul 13, 2022 · 1 revision

Animal GameObject

The Animal GameObject contains a Navmesh Agent that allows us to control its position and behaviour. It also contains an Animator and the Animal.cs script.

Animal Script

The Animal script is not much complex as it contains pretty much only the logic for the animals and its State Machine.

Animal State Machine

The animal state machine is pretty simple. It's comprised of four common states, "Idle", "Roam", "Attack" and "Flee". You can easily understand what they do by reading their own names. Idle means the creature is doing nothing at all. Roam means it's just wandering around searching for food or water. Attack means they've considered the Player a threat. Flee means they're afraid to die and they try to run away

image

Clone this wiki locally