A* Pathfinding Project
4.3.2
The A* Pathfinding Project for Unity 3D
|
AI controller specifically made for the spider robot. More...
AI controller specifically made for the spider robot.
Public Attributes | |
Animation | anim |
Animation component. More... | |
float | animationSpeed = 0.2F |
Speed relative to velocity with which to play animations. More... | |
GameObject | endOfPathEffect |
Effect which will be instantiated when end of path is reached. More... | |
float | sleepVelocity = 0.4F |
Minimum velocity for moving. More... | |
![]() | |
bool | alwaysDrawGizmos |
Draws detailed gizmos constantly in the scene view instead of only when the agent is selected and settings are being modified. More... | |
bool | constrainInsideGraph = false |
Ensure that the character is always on the traversable surface of the navmesh. More... | |
float | maxAcceleration = -2.5f |
How quickly the agent accelerates. More... | |
float | pickNextWaypointDist = 2 |
How far the AI looks ahead along the path to determine the point it moves to. More... | |
float | rotationSpeed = 360 |
Rotation speed in degrees per second. More... | |
float | slowdownDistance = 0.6F |
Distance from the end of the path where the AI will start to slow down. More... | |
bool | slowWhenNotFacingTarget = true |
Slow down when not facing the target direction. More... | |
![]() | |
bool | canMove = true |
Enables or disables movement completely. More... | |
bool | canSearch = true |
Enables or disables recalculating the path at regular intervals. More... | |
bool | enableRotation = true |
If true, the AI will rotate to face the movement direction. More... | |
float | endReachedDistance = 0.2f |
Distance to the end point to consider the end of path to be reached. More... | |
Vector3 | gravity = new Vector3(float.NaN, float.NaN, float.NaN) |
Gravity to use. More... | |
LayerMask | groundMask = -1 |
Layer mask to use for ground placement. More... | |
float | height = 2 |
Radius of the agent in world units. More... | |
float | maxSpeed = 1 |
Max speed in world units per second. More... | |
IMovementPlane | movementPlane = GraphTransform.identityTransform |
Plane which this agent is moving in. More... | |
OrientationMode | orientation = OrientationMode.ZAxisForward |
Determines which direction the agent moves in. More... | |
float | radius = 0.5f |
Height of the agent in world units. More... | |
float | repathRate = 0.5f |
Determines how often the agent will search for new paths (in seconds). More... | |
RVODestinationCrowdedBehavior | rvoDensityBehavior = new RVODestinationCrowdedBehavior(true, 0.5f, false) |
Controls if the agent slows down to a stop if the area around the destination is crowded. More... | |
bool | updatePosition = true |
Determines if the character's position should be coupled to the Transform's position. More... | |
bool | updateRotation = true |
Determines if the character's rotation should be coupled to the Transform's rotation. More... | |
CloseToDestinationMode | whenCloseToDestination = CloseToDestinationMode.Stop |
What to do when within endReachedDistance units from the destination. More... | |
Additional Inherited Members | |
![]() | |
Vector3 | CalculateVelocity (Vector3 position) |
Current desired velocity of the agent (excluding physics and local avoidance but it includes gravity). More... | |
virtual void | OnTargetReached () |
The end of the path has been reached. More... | |
override void | Teleport (Vector3 newPosition, bool clearPath=true) |
Instantly move the agent to a new position. More... | |
![]() | |
virtual void | FinalizeMovement (Vector3 nextPosition, Quaternion nextRotation) |
Moves the agent to a position. More... | |
virtual Vector3 | GetFeetPosition () |
Position of the base of the character. More... | |
virtual void | Move (Vector3 deltaPosition) |
Move the agent. More... | |
void | MovementUpdate (float deltaTime, out Vector3 nextPosition, out Quaternion nextRotation) |
Calculate how the character wants to move during this frame. More... | |
virtual void | SearchPath () |
Recalculate the current path. More... | |
void | SetPath (Path path) |
Make the AI follow the specified path. More... | |
Quaternion | SimulateRotationTowards (Vector3 direction, float maxDegrees) |
Simulates rotating the agent towards the specified direction and returns the new rotation. More... | |
![]() | |
void | FinalizeMovement (Vector3 nextPosition, Quaternion nextRotation) |
Move the agent. More... | |
void | Move (Vector3 deltaPosition) |
Move the agent. More... | |
void | MovementUpdate (float deltaTime, out Vector3 nextPosition, out Quaternion nextRotation) |
Calculate how the character wants to move during this frame. More... | |
void | SearchPath () |
Recalculate the current path. More... | |
void | SetPath (Path path) |
Make the AI follow the specified path. More... | |
![]() | |
static readonly Color | ShapeGizmoColor = new Color(240/255f, 213/255f, 30/255f) |
![]() | |
virtual void | CalculateNextRotation (float slowdown, out Quaternion nextRotation) |
override Vector3 | ClampToNavmesh (Vector3 position, out bool positionChanged) |
Constrains the character's position to lie on the navmesh. More... | |
override void | ClearPath () |
Clears the current path of the agent. More... | |
override void | MovementUpdateInternal (float deltaTime, out Vector3 nextPosition, out Quaternion nextRotation) |
Called during either Update or FixedUpdate depending on if rigidbodies are used for movement or not. More... | |
override void | OnDisable () |
override void | OnPathComplete (Path newPath) |
Called when a requested path has been calculated. More... | |
override int | OnUpgradeSerializedData (int version, bool unityThread) |
Handle serialization backwards compatibility. More... | |
![]() | |
void | ApplyGravity (float deltaTime) |
Accelerates the agent downwards. More... | |
Vector2 | CalculateDeltaToMoveThisFrame (Vector2 position, float distanceToEndOfPath, float deltaTime) |
Calculates how far to move during a single frame. More... | |
virtual void | CalculatePathRequestEndpoints (out Vector3 start, out Vector3 end) |
Outputs the start point and end point of the next automatic path request. More... | |
void | CancelCurrentPathRequest () |
virtual void | FindComponents () |
virtual void | OnDrawGizmos () |
virtual void | OnDrawGizmosSelected () |
virtual void | OnEnable () |
Called when the component is enabled. More... | |
virtual void | OnUpdate (float dt) |
Called every frame. More... | |
Vector3 | RaycastPosition (Vector3 position, float lastElevation) |
Checks if the character is grounded and prevents ground penetration. More... | |
override void | Reset () |
Handle serialization backwards compatibility. More... | |
Quaternion | SimulateRotationTowards (Vector2 direction, float maxDegrees) |
Simulates rotating the agent towards the specified direction and returns the new rotation. More... | |
virtual void | Start () |
Starts searching for paths. More... | |
void | UpdateVelocity () |
![]() | |
virtual void | Awake () |
![]() | |
PathInterpolator | interpolator = new PathInterpolator() |
Helper which calculates points along the current path. More... | |
Path | path |
Current path which is followed. More... | |
![]() | |
CharacterController | controller |
Cached CharacterController component. More... | |
Vector2 | lastDeltaPosition |
Amount which the character wants or tried to move with during the last frame. More... | |
float | lastDeltaTime |
Delta time used for movement during the last frame. More... | |
float | lastRepath = float.NegativeInfinity |
Time when the last path request was started. More... | |
int | prevFrame |
Last frame index when prevPosition1 was updated. More... | |
Vector3 | prevPosition1 |
Position of the character at the end of the last frame. More... | |
Vector3 | prevPosition2 |
Position of the character at the end of the frame before the last frame. More... | |
Rigidbody | rigid |
Cached Rigidbody component. More... | |
Rigidbody2D | rigid2D |
Cached Rigidbody component. More... | |
RVOController | rvoController |
Cached RVOController component. More... | |
Seeker | seeker |
Cached Seeker component. More... | |
Vector3 | simulatedPosition |
Position of the agent. More... | |
Quaternion | simulatedRotation |
Rotation of the agent. More... | |
Transform | tr |
Cached Transform component. More... | |
Vector2 | velocity2D |
Current desired velocity of the agent (does not include local avoidance and physics). More... | |
float | verticalVelocity |
Velocity due to gravity. More... | |
bool | waitingForPathCalculation = false |
Only when the previous path has been calculated should the script consider searching for a new path. More... | |
![]() | |
bool IAstarAI. | canMove [get, set] |
Enables or disables movement completely. More... | |
bool IAstarAI. | canSearch [get, set] |
Enables or disables recalculating the path at regular intervals. More... | |
bool | hasPath [get] |
True if this agent currently has a path that it follows. More... | |
float IAstarAI. | height [get, set] |
Radius of the agent in world units. More... | |
float IAstarAI. | maxSpeed [get, set] |
Max speed in world units per second. More... | |
bool | pathPending [get] |
True if a path is currently being calculated. More... | |
float IAstarAI. | radius [get, set] |
Height of the agent in world units. More... | |
override bool | reachedDestination [get] |
True if the ai has reached the destination. More... | |
bool | reachedEndOfPath [get, protected set] |
True if the agent has reached the end of the current path. More... | |
float | remainingDistance [get] |
Remaining distance along the current path to the end of the path. More... | |
float | speed [get, set] |
Maximum speed in world units per second. More... | |
Vector3 | steeringTarget [get] |
Point on the path which the agent is currently moving towards. More... | |
Vector3 | targetDirection [get] |
Direction that the agent wants to move in (excluding physics and local avoidance). More... | |
bool | TargetReached [get] |
True if the end of the path has been reached. More... | |
float | turningSpeed [get, set] |
Rotation speed. More... | |
![]() | |
float | centerOffset [get, set] |
Offset along the Y coordinate for the ground raycast start position. More... | |
Vector3 | desiredVelocity [get] |
Velocity that this agent wants to move with. More... | |
Vector3 | destination [get, set] |
Position in the world that this agent should move to. More... | |
bool | isStopped [get, set] |
Gets or sets if the agent should stop moving. More... | |
System.Action | onSearchPath [get, set] |
Called when the agent recalculates its path. More... | |
Vector3 | position [get] |
Position of the agent. More... | |
abstract bool | reachedDestination [get] |
True if the ai has reached the destination. More... | |
Quaternion | rotation [get] |
Rotation of the agent. More... | |
bool | rotationIn2D [get, set] |
If true, the forward axis of the character will be along the Y axis instead of the Z axis. More... | |
virtual bool | shouldRecalculatePath [get] |
True if the path should be automatically recalculated as soon as possible. More... | |
Transform | target [get, set] |
Target to move towards. More... | |
bool | usingGravity [get, set] |
Indicates if gravity is used during this frame. More... | |
Vector3 | velocity [get] |
Actual velocity that the agent is moving with. More... | |
![]() | |
int Util.IEntityIndex. | EntityIndex [get, set] |
Internal entity index used by #BurstBatchHelper. More... | |
![]() | |
int | EntityIndex [get, set] |
![]() | |
bool | canMove [get, set] |
Enables or disables movement completely. More... | |
bool | canSearch [get, set] |
Enables or disables recalculating the path at regular intervals. More... | |
Vector3 | desiredVelocity [get] |
Velocity that this agent wants to move with. More... | |
Vector3 | destination [get, set] |
Position in the world that this agent should move to. More... | |
bool | hasPath [get] |
True if this agent currently has a path that it follows. More... | |
float | height [get, set] |
Radius of the agent in world units. More... | |
bool | isStopped [get, set] |
Gets or sets if the agent should stop moving. More... | |
float | maxSpeed [get, set] |
Max speed in world units per second. More... | |
System.Action | onSearchPath [get, set] |
Called when the agent recalculates its path. More... | |
bool | pathPending [get] |
True if a path is currently being calculated. More... | |
Vector3 | position [get] |
Position of the agent. More... | |
float | radius [get, set] |
Height of the agent in world units. More... | |
bool | reachedDestination [get] |
True if the ai has reached the destination. More... | |
bool | reachedEndOfPath [get] |
True if the agent has reached the end of the current path. More... | |
float | remainingDistance [get] |
Remaining distance along the current path to the end of the path. More... | |
Quaternion | rotation [get] |
Rotation of the agent. More... | |
Vector3 | steeringTarget [get] |
Point on the path which the agent is currently moving towards. More... | |
Vector3 | velocity [get] |
Actual velocity that the agent is moving with. More... | |
Animation anim |
Animation component.
Should hold animations "awake" and "forward"
float animationSpeed = 0.2F |
Speed relative to velocity with which to play animations.
GameObject endOfPathEffect |
Effect which will be instantiated when end of path is reached.
float sleepVelocity = 0.4F |
Minimum velocity for moving.