Links

AI Animal Control

Overview

This component is the bridge between the Animal Controller with the Unity Navmesh system.
The Animal uses the function Move(Vector3 Direction) to move around.
This component moves the animal by using a target Position or Transform. It gets the Direction of the the Navmesh Agent desired Velocity and feeds it into the Animal controller.
Is a basic way to move the animal around in an environment, using all the rules of a Navmesh like jumping, falling from a cliff or staying on the Navmesh. It can also interact automatically with Zones.

Requirements

  • The component needs an Navmesh Agent.
  • Since the animals has the Pivot of the Root Gameobject on the center of the back feet; its better to have All the AI Components in a Child Object and move it to the front feet of the Animal

Parameters [General]

Target

The Transform reference used to calculate the direction to move.

NextTarget

Reference of the Next Target stored after the animal arrives to the current target.

Auto Next Target

When the Animal arrives to a Waypoint it will automatically search for the Next Target.
If the Brain Component is used, this will be set to false.

Auto Interact

When the animal arrives to a Waypoint and that waypoint is an Interactable. it will Interact with it.
If the Brain Component is used, this will be set to false.

Update Destination

If the Target changes position, the AI Movement Logic will be re-calculated.
If the Brain Component is used, this will be set to false.

Move on Moving Target

If the Animal has arrived to its destination Target and this targets moves to a new position, the AI movement logic will be recalculated.
If the Brain Component is used, this will be set to false.

Look Target on Arrival

When the animal arrives to a Waypoint, it will align the animal to Look At the target
If the Brain Component is used this will be set to false.

Stopping Distance

Default stopping distance the Animal will use to arrive to a Target. Waypoints and AI Targets will have their own stopping distance value

Agent

Reference for the Nav Mesh Agent

Animal

Reference for the Animal Component

Events

On Position Arrived(Vector3)

Invoked when the Animal arrives to a Target Position. E.g. When the Animal is set to a position with the Click Point Mode .

On Target Arrived(Transform)

Invoked when the Animal arrives to a Target Transform

On New Target Set(Transform)

Invoked when is Assigned a new Target

Debug

When the Editor is Playing all internal variables are shown. This is perfect for debugging the AI main Parameters.

Debug Log

Print to the console all the Notifications of the Animal AI Control

Debug Gizmos

Shows on the Scene all the gizmos of the Animal AI Control