Base class for AIPath and RichAI.
More...
Base class for AIPath and RichAI.
|
float | centerOffset = 1 |
| Offset along the Y coordinate for the ground raycast start position.
|
|
Vector3 | gravity = new Vector3(float.NaN, float.NaN, float.NaN) |
| Gravity to use.
|
|
LayerMask | groundMask = -1 |
| Layer mask to use for ground placement.
|
|
bool | rotationIn2D = false |
| If true, the forward axis of the character will be along the Y axis instead of the Z axis.
|
|
|
void | ApplyGravity (float deltaTime) |
|
override void | Awake () |
| Initializes reference variables.
|
|
Vector2 | CalculateDeltaToMoveThisFrame (Vector2 position, float distanceToEndOfPath, float deltaTime) |
|
virtual Vector3 | ClampToNavmesh (Vector3 position) |
| Constrains the character's position to lie on the navmesh.
|
|
virtual void | FixedUpdate () |
| Called every physics update.
|
|
void | Move (Vector3 position3D, Vector3 deltaPosition) |
|
abstract void | MovementUpdate (float deltaTime) |
| Called during either Update or FixedUpdate depending on if rigidbodies are used for movement or not.
|
|
virtual void | OnDrawGizmos () |
|
Vector3 | RaycastPosition (Vector3 position, float lastElevation) |
| Find the world position of the ground below the character.
|
|
virtual void | RotateTowards (Vector2 direction, float maxDegrees) |
| Rotates in the specified direction.
|
|
virtual void | Update () |
| Called every frame.
|
|
virtual int | OnUpgradeSerializedData (int version) |
| Handle serialization backwards compatibility.
|
|
|
static readonly Color | GizmoColorRaycast = new Color(118.0f/255, 206.0f/255, 112.0f/255) |
|
|
bool | usingGravity [get, set] |
| Indicates if gravity is used during this frame.
|
|
void ApplyGravity |
( |
float |
deltaTime | ) |
|
|
protected |
Vector2 CalculateDeltaToMoveThisFrame |
( |
Vector2 |
position, |
|
|
float |
distanceToEndOfPath, |
|
|
float |
deltaTime |
|
) |
| |
|
protected |
virtual Vector3 ClampToNavmesh |
( |
Vector3 |
position | ) |
|
|
protectedvirtual |
Constrains the character's position to lie on the navmesh.
Not all movement scripts have support for this.
Reimplemented in RichAI.
virtual void FixedUpdate |
( |
| ) |
|
|
protectedvirtual |
Called every physics update.
If rigidbodies are used then all movement happens here
void Move |
( |
Vector3 |
position3D, |
|
|
Vector3 |
deltaPosition |
|
) |
| |
|
protected |
abstract void MovementUpdate |
( |
float |
deltaTime | ) |
|
|
protectedpure virtual |
Called during either Update or FixedUpdate depending on if rigidbodies are used for movement or not.
Implemented in RichAI, and AIPath.
virtual void OnDrawGizmos |
( |
| ) |
|
|
protectedvirtual |
Vector3 RaycastPosition |
( |
Vector3 |
position, |
|
|
float |
lastElevation |
|
) |
| |
|
protected |
Find the world position of the ground below the character.
virtual void RotateTowards |
( |
Vector2 |
direction, |
|
|
float |
maxDegrees |
|
) |
| |
|
protectedvirtual |
Rotates in the specified direction.
Rotates around the Y-axis.
- See Also
- turningSpeed
Offset along the Y coordinate for the ground raycast start position.
Normally the pivot of the character is at the character's feet, but you usually want to fire the raycast from the character's center, so this value should be half of the character's height.
A green gizmo line will be drawn upwards from the pivot point of the character to indicate where the raycast will start.
- See Also
- gravity
CharacterController controller |
|
protected |
Cached CharacterController component.
readonly Color GizmoColorRaycast = new Color(118.0f/255, 206.0f/255, 112.0f/255) |
|
staticprotected |
Vector3 gravity = new Vector3(float.NaN, float.NaN, float.NaN) |
Gravity to use.
If set to (NaN,NaN,NaN) then Physics.Gravity (configured in the Unity project settings) will be used. If set to (0,0,0) then no gravity will be used and no raycast to check for ground penetration will be performed.
LayerMask groundMask = -1 |
Cached Rigidbody component.
Cached Rigidbody component.
bool rotationIn2D = false |
If true, the forward axis of the character will be along the Y axis instead of the Z axis.
For 3D games you most likely want to leave this the default value which is false. For 2D games you most likely want to change this to true as in 2D games you usually want the Y axis to be the forwards direction of the character.
Cached RVOController component.
Cached Transform component.
Current desired velocity of the agent.
Lies in the movement plane.
Velocity due to gravity.
Perpendicular to the movement plane.
Indicates if gravity is used during this frame.
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Core/AI/AIBase.cs