Animal Brain
Last updated
Last updated
The Animal brain component is used to give life to animals that are not controlled by player Input.
It is heavily based on the Unity Tutorial: Pluggable AI with Scriptable Objects
Based on AI States and Decisions you can give Tasks to the animal to wander, attack the player on sight , be your companion.. etc.
Reference for a GameObject that it will be used on Tasks and decisions alike to cast rays and execute logics using a reference point.
Starting AI State the brain will execute
Time needed to make a new transition. Necessary to avoid Changing to multiple States in the same frame
Removes all AI Components when the Animal Dies. (Brain, AiControl, Agent).
Invoked when a new State starts. It uses the AI State ID as parameter
Invoked when a new Task starts. It uses the AI State ID as parameter.
It is only Invoked if the Task ID is different of zero[0].
Invoked when a task has completed. It uses the AI State ID as parameter
Invoked when a decision succeeded. It uses the AI State ID as parameter.
Shows the debug window on the screen for the animal when playing: