You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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