Animal Brain

Overview

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.

Parameters

Eyes

Reference for a GameObject that it will be used on Tasks and decisions alike to cast rays and execute logics using a reference point.

Current AI State

Starting AI State the brain will execute

Transition Cool Down

Time needed to make a new transition. Necessary to avoid Changing to multiple States in the same frame

Remove AI on Death

Removes all AI Components when the Animal Dies. (Brain, AiControl, Agent).

Events

On AI State Changed

Invoked when a new State starts. It uses the AI State ID as parameter

On Task Started

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].

On Task Done

Invoked when a task has completed. It uses the AI State ID as parameter

On Decision Succeeded

Invoked when a decision succeeded. It uses the AI State ID as parameter.

Debug

Debug On Screen

Shows the debug window on the screen for the animal when playing:

Last updated