Arbor 3: FSM & BT Graph Editor 3.6.8

Public Types | Public Member Functions | Properties | List of all members
AgentController Class Reference

AI for the movement component that wraps the NavMeshAgent. More...

Inherits MonoBehaviour, and ISerializationCallbackReceiver.

## Public Types
enum | MovementType { NotChange, Normalize, DivSpeed, DivValue }
| Type of movement vector More...
enum | TurnType { UseX, RadianAngle }
| Type of Turn More...

## Public Member Functions
void | Patrol (Vector3 center, float speed, float radius)
| Wander within specified radius More...
void | Patrol (float speed, float radius)
| Wander within the specified radius from the start position More...
void | Follow (float speed, float stoppingDistance, Vector3 targetPosition)
| It approaches the specified position More...
void | Follow (float speed, float stoppingDistance, Transform target)
| Approach to the position of the specified Transform More...
void | Escape (float speed, float distance, Vector3 targetPosition)
| Keep away from specified position More...
void | Escape (float speed, float distance, Transform target)
| Away from the specified Transform More...
void | LookAt (float angularSpeed, Vector3 targetPosition)
| Rotate in the direction of the specified position. More...
void | LookAt (float angularSpeed, Transform target)
| Rotates in the direction of the specified Transform. More...
void | Resume ()
| Resume movement. More...
void | Stop ()
| Stop. More...
bool | Warp (Vector3 newPosition)
| Warps agent to the provided position. More...

## Properties
NavMeshAgent | agent`[get, set]`
| NavMeshAgent you want to control. More...
Animator | animator`[get, set]`
| Animator you want to control. More...
string | movingParameter`[get, set]`
| Specify the bool parameter for setting to the Animator whether or not the Agent is moving. More...
float | movingSpeedThreshold`[get, set]`
| Threshold value of the speed of moving More...
string | speedParameter`[get, set]`
| Specify the float parameter for setting the moving speed to Animator. More...
bool | isDivAgentSpeed`[get, set]`
| Whether or not to divide by the speed set for Agent. More...
float | speedDampTime`[get, set]`
| Dump time of moving speed. More...
MovementType | movementType`[get, set]`
| Type of movement vector. More...
float | movementDivValue`[get, set]`
| The value to divide for velocity. More...
string | movementXParameter`[get, set]`
| Specify the float parameter for setting the X value of the moving vector in the Agent's local space to Animator. More...
float | movementXDampTime`[get, set]`
| Dump time of X value of moving direction vector. More...
string | movementYParameter`[get, set]`
| Specify the float parameter for setting the Y value of the moving direction vector in the Agent's local space to Animator. More...
float | movementYDampTime`[get, set]`
| Dump time of Y value of moving direction vector. More...
string | movementZParameter`[get, set]`
| Specify the float parameter for setting the Z value of the moving direction vector in the Agent's local space to Animator. More...
float | movementZDampTime`[get, set]`
| Dump time of Z value of moving direction vector. More...
string | turnParameter`[get, set]`
| Specify the float parameter for setting the turn direction to Animator. More...
TurnType | turnType`[get, set]`
| Type of Turn. More...
float | turnDampTime`[get, set]`
| Dump time in the turn direction. More...
Transform | agentTransform`[get]`
| Agent Transform More...
bool | isDone`[get]`
| Whether the move is complete or not. More...
bool | isMoving`[get]`
| Whether it is moving More...

## Detailed Description

AI for the movement component that wraps the NavMeshAgent.

Used mainly through built-in Behavior's Agent.

## Member Enumeration Documentation

## ◆ MovementType

enum MovementType
| strong

Type of movement vector

Enumerator
NotChange | Use the value of NavMeshAgent.velocity as it is.
Normalize | Use the normalized value of NavMeshAgent.velocity.
DivSpeed | Use the value obtained by dividing NavMeshAgent.velocity by NavMeshAgent.speed.
DivValue | Use the value obtained by dividing NavMeshAgent.velocity by MovementDivValue.

## ◆ TurnType

enum TurnType
| strong

Type of Turn

Enumerator
UseX | Use the X value of the orientation vector.
RadianAngle | Calculate the radian angle from the XZ value of the direction vector.

## Member Function Documentation

## ◆ Escape() [1/2]

void Escape | ( | float | speed,
|  | float | distance,
|  | Transform | target
| ) |  |

Away from the specified Transform

Parameters

  speed | Movement speed
  distance | Distance away
  target | Target

## ◆ Escape() [2/2]

void Escape | ( | float | speed,
|  | float | distance,
|  | Vector3 | targetPosition
| ) |  |

Keep away from specified position

Parameters

  speed | Movement speed
  distance | Distance away
  targetPosition | Target

## ◆ Follow() [1/2]

void Follow | ( | float | speed,
|  | float | stoppingDistance,
|  | Transform | target
| ) |  |

Approach to the position of the specified Transform

Parameters

  speed | Movement speed
  stoppingDistance | Stopping distance
  target | Objective point

## ◆ Follow() [2/2]

void Follow | ( | float | speed,
|  | float | stoppingDistance,
|  | Vector3 | targetPosition
| ) |  |

It approaches the specified position

Parameters

  speed | Movement speed
  stoppingDistance | Stopping distance
  targetPosition | Objective point

## ◆ LookAt() [1/2]

void LookAt | ( | float | angularSpeed,
|  | Transform | target
| ) |  |

Rotates in the direction of the specified Transform.

Parameters

  angularSpeed | angular speed
  target | Target

## ◆ LookAt() [2/2]

void LookAt | ( | float | angularSpeed,
|  | Vector3 | targetPosition
| ) |  |

Rotate in the direction of the specified position.

Parameters

  angularSpeed | angular speed
  targetPosition | Target

## ◆ Patrol() [1/2]

void Patrol | ( | float | speed,
|  | float | radius
| ) |  |

Wander within the specified radius from the start position

Parameters

  speed | Movement speed
  radius | Radius from the starting position

## ◆ Patrol() [2/2]

void Patrol | ( | Vector3 | center,
|  | float | speed,
|  | float | radius
| ) |  |

Wander within specified radius

Parameters

  center | Center
  speed | Movement speed
  radius | Radius from the starting position

## ◆ Resume()

void Resume | ( |  | ) |

Resume movement.

## ◆ Stop()

void Stop | ( |  | ) |

Stop.

## ◆ Warp()

bool Warp | ( | Vector3 | newPosition | ) |

Warps agent to the provided position.

Parameters

  newPosition | New position to warp the agent to.

Returns
  True if agent is successfully warped, otherwise false.

## Property Documentation

## ◆ agent

NavMeshAgent agent
| get set

NavMeshAgent you want to control.

## ◆ agentTransform

Transform agentTransform
| get

Agent Transform

## ◆ animator

Animator animator
| get set

Animator you want to control.

## ◆ isDivAgentSpeed

bool isDivAgentSpeed
| get set

Whether or not to divide by the speed set for Agent.

## ◆ isDone

bool isDone
| get

Whether the move is complete or not.

## ◆ isMoving

bool isMoving
| get

Whether it is moving

## ◆ movementDivValue

float movementDivValue
| get set

The value to divide for velocity.

(Used only when _MovementType is MovementType.DivValue)

Disable If you specify 0.

## ◆ movementType

MovementType movementType
| get set

Type of movement vector.

## ◆ movementXDampTime

float movementXDampTime
| get set

Dump time of X value of moving direction vector.

## ◆ movementXParameter

string movementXParameter
| get set

Specify the float parameter for setting the X value of the moving vector in the Agent's local space to Animator.

## ◆ movementYDampTime

float movementYDampTime
| get set

Dump time of Y value of moving direction vector.

## ◆ movementYParameter

string movementYParameter
| get set

Specify the float parameter for setting the Y value of the moving direction vector in the Agent's local space to Animator.

## ◆ movementZDampTime

float movementZDampTime
| get set

Dump time of Z value of moving direction vector.

## ◆ movementZParameter

string movementZParameter
| get set

Specify the float parameter for setting the Z value of the moving direction vector in the Agent's local space to Animator.

## ◆ movingParameter

string movingParameter
| get set

Specify the bool parameter for setting to the Animator whether or not the Agent is moving.

## ◆ movingSpeedThreshold

float movingSpeedThreshold
| get set

Threshold value of the speed of moving

## ◆ speedDampTime

float speedDampTime
| get set

Dump time of moving speed.

## ◆ speedParameter

string speedParameter
| get set

Specify the float parameter for setting the moving speed to Animator.

## ◆ turnDampTime

float turnDampTime
| get set

Dump time in the turn direction.

## ◆ turnParameter

string turnParameter
| get set

Specify the float parameter for setting the turn direction to Animator.

## ◆ turnType

TurnType turnType
| get set

Type of Turn.