Advanced AI for navmesh based graphs.
More...
Advanced AI for navmesh based graphs.
- A* Pro Feature:
- This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited
The Pro version can be bought here
|
static readonly Color | GizmoColorPath = new Color(8.0f/255,78.0f/255,194.0f/255) |
|
static readonly Color | GizmoColorRaycast = new Color(118.0f/255,206.0f/255,112.0f/255) |
|
|
virtual void | OnEnable () |
| Run at start and when reenabled.
|
|
virtual void | OnTargetReached () |
| Called when the end of the path is reached.
|
|
virtual void | Start () |
| Starts searching for paths.
|
|
virtual void | Update () |
| Update is called once per frame.
|
|
virtual Vector3 | UpdateTarget (RichFunnel fn) |
|
|
static float | deltaTime = 0 |
| Smooth delta time to avoid getting overly effected by e.g GC.
|
|
Declare that the AI has completely traversed the current part.
This will skip to the next part, or call OnTargetReached if this was the last part
virtual void OnEnable |
( |
| ) |
|
|
protectedvirtual |
Run at start and when reenabled.
Starts RepeatTrySearchPath.
- See Also
- Start
void OnPathComplete |
( |
Path |
p | ) |
|
|
private |
virtual void OnTargetReached |
( |
| ) |
|
|
protectedvirtual |
Called when the end of the path is reached.
Vector3 RaycastPosition |
( |
Vector3 |
position, |
|
|
float |
lasty |
|
) |
| |
|
private |
bool RotateTowards |
( |
Vector3 |
trotdir | ) |
|
|
private |
Rotates along the Y-axis the transform towards trotdir.
IEnumerator SearchPaths |
( |
| ) |
|
|
private |
Starts searching for paths.
If you override this function you should in most cases call base.Start () at the start of it.
- See Also
- OnEnable
-
SearchPaths
Update is called once per frame.
virtual void UpdatePath |
( |
| ) |
|
|
virtual |
Force recalculation of the current path.
If there is an ongoing path calculation, it will be canceled (so make sure you leave time for the paths to get calculated before calling this function again).
Reimplemented in LocalSpaceRichAI.
Max acceleration of the agent.
World units per second per second
List<Vector3> buffer = new List<Vector3>() |
|
protected |
bool canSearchPath = false |
|
protected |
CharacterController controller |
|
private |
Vector3 currentTargetDirection |
|
private |
bool delayUpdatePath = false |
|
protected |
Smooth delta time to avoid getting overly effected by e.g GC.
float distanceToWaypoint = 999 |
|
private |
Draw gizmos in the scene view.
float endReachedDistance = 0.01f |
Max distance to the endpoint to consider it reached.
Mode for funnel simplification.
On tiled navmesh maps, but sometimes on normal ones as well, it can be good to simplify the funnel as a post-processing step.
readonly Color GizmoColorPath = new Color(8.0f/255,78.0f/255,194.0f/255) |
|
static |
readonly Color GizmoColorRaycast = new Color(118.0f/255,206.0f/255,112.0f/255) |
|
static |
Vector3 gravity = new Vector3(0,-9.82f,0) |
Gravity to use in case no character controller is attached.
LayerMask groundMask = -1 |
Layer mask to use for ground placement.
Make sure this does not include the layer of any eventual colliders attached to this gameobject.
Max speed of the agent.
World units per second
bool preciseSlowdown = true |
Use a 3rd degree equation for calculating slowdown acceleration instead of a 2nd degree.
A 3rd degree equation can also make sure that the velocity when reaching the target is roughly zero and therefore it will have a more direct stop. In contrast solving a 2nd degree equation which will just make sure the target is reached but will usually have a larger velocity when reaching the target and therefore look more "bouncy".
bool raycastingForGroundPlacement = true |
Raycast for ground placement (when not having a CharacterController).
A raycast from position + up*centerOffset downwards will be done and the agent will be placed at this point.
Delay (seconds) between path searches.
bool repeatedlySearchPaths = false |
Search for new paths repeatedly.
float rotationSpeed = 360 |
Max rotation speed of the agent.
In degrees per second.
float slowdownTime = 0.5f |
How much time to use for slowdown in the end of the path.
A lower value give more abrupt stops
bool slowWhenNotFacingTarget = true |
Slow down when not facing the target direction.
Incurs at a small overhead.
bool traversingSpecialPath = false |
|
protected |
Current velocity of the agent.
Includes eventual velocity due to gravity
bool waitingForPathCalc = false |
|
protected |
List<Vector3> wallBuffer = new List<Vector3>() |
|
protected |
Walls within this range will be used for avoidance.
Setting this to zero disables wall avoidance and may improve performance slightly
Force to avoid walls with.
The agent will try to steer away from walls slightly.
bool ApproachingPartEndpoint |
|
get |
True if approaching the last waypoint in the current path.
bool ApproachingPathEndpoint |
|
get |
True if approaching the last waypoint of all parts in the current path.
float DistanceToNextWaypoint |
|
get |
Distance to the next waypoint.
Current velocity of the agent.
Includes eventual velocity due to gravity
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Core/AI/RichAI.cs