AI Animal Control
✔
Last updated
✔
Last updated
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 Navmesh Agent's desired Velocity and feeds it into the Animal controller.
It 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.
The component needs a Navmesh Agent.
Since the animals have the Pivot of the Root Gameobject on the center of the back feet; it is better to have all the AI Components in a Child Object and move it to the front feet of the Animal.
The Transform reference used to calculate the direction to move.
Reference of the Next Target stored, (given by the target) when the animal arrives at the current target.
How often the path for the agent should be recalculated - lower numbers mean less performance.
Default stopping distance the Animal will use to arrive at a Target. Waypoints and AI Targets will have their own stopping distance value.
You can add the AI Target component to any other Object to override this default value.
Distance to start slowing the animal before arriving at the destination
Distance from the Animals root to apply the LookAt Target logic when the animal arrives to a target
Stop Distance used on the SetDestination method. This is commonly used on the Point Click component.
Limit for the Slowing Multiplier to be applied to the Speed Multiplier
Multiplier used for Waypoints Wait time. Set it to 0 if you want to ignore waiting on waypoints.
If true then it disables the input component on the animal. This will avoid the AI and Player Input to fight over controlling the Character
Reference for the Animal Component
Reference for the Nav Mesh Agent
Allows you to determine specific states to Stop the Agent working on. E.g. if you have a Fall state here, then it stops the agent working on the fall state.
Invoked when the AI Control is enabled
Invoked when the AI Control is disabled
Invoked when the Animal arrives at a Target Position. E.g. When the Animal is set to a position with the Click Point Component.
Invoked when the Animal arrives at a Target Transform
Invoked when is Assigned a new Target.
When the Editor is Playing all internal variables are shown. This is perfect for debugging the AI main Parameters.
Print to the console all the Notifications of the Animal AI Control.
Shows in the scene on top of each AI animal the main values while using the component
Shows on the Scene all the gizmos of the Animal AI Control