Scripting API
Scripting API
NavMeshAgent3D
Struct in Abyss.Navigation, from Abyss.Navigation.
Something that walks the navmesh of its agent type to where it is sent — NavMeshAgent3D.Destination, or NavMeshAgent3D.Target's entity wherever that goes — along a path around what is in its way, steering around the other agents and the obstacles that move. While the game plays, never while it is edited.
public struct NavMeshAgent3DRemarks
It moves its entity: puts it where it walks on the navmesh, NavMeshAgent3D.BaseOffset above it, and turns its +Z, where an imported model faces, to where it walks. With NavMeshAgent3D.UpdatePosition or NavMeshAgent3D.UpdateRotation off it only steers: a system or a Rigidbody 3D moves the entity, reading NavMeshAgent3D.Velocity, and the agent follows where it went.
Sent by its fields: a system sets NavMeshAgent3D.Destination and NavMeshAgent3D.HasDestination, or NavMeshAgent3D.Target, and the agent goes; NavMeshAgent3D.Stopped halts it where it is.
Across links (NavMeshLink3D) on its path: it walks to the link's start, then jumps in an arc to its end where the two differ in height by more than its step or a gap lies between, and walks straight across otherwise, at its NavMeshAgent3D.Speed; NavMeshAgent3D.OnLink is set meanwhile and NavMeshAgent3D.LinkProgress goes from 0 to 1. With NavMeshAgent3D.AutoTraverse off it stops as it comes to the link, a step or two from its start, and waits for the game's code, which moves its entity across (NavMeshAgent3D.LinkStart to NavMeshAgent3D.LinkEnd) and clears NavMeshAgent3D.OnLink; it walks on from where its entity is then.
Constructors
NavMeshAgent3D
public NavMeshAgent3D()Of the first agent type, walking as most engines' first agent does.
Fields
AgentType
public int AgentTypeWhich agent type it is: its place in Project Settings ▸ Navigation, which says how wide and tall it is.
Speed
public float SpeedHow fast it walks, in meters a second.
AngularSpeed
public float AngularSpeedHow fast it turns to where it walks, in degrees a second.
Acceleration
public float AccelerationHow fast it gets up to speed, and slows, in meters a second each second.
StoppingDistance
public float StoppingDistanceHow near where it is sent it stops, in meters.
AutoBraking
public bool AutoBrakingWhether it slows as it comes to where it is sent, rather than walking into it at speed.
BaseOffset
public float BaseOffsetHow far above the navmesh its entity is put, in meters: where the entity's middle is above its feet.
Avoidance
public NavMeshAvoidance3D AvoidanceHow well it steers around the others.
Priority
public int PriorityHow readily it gives way, 0 to 99: one numbered higher steps aside for one numbered lower.
UpdatePosition
public bool UpdatePositionWhether it puts its entity where it walks; off, something else moves the entity and it follows.
UpdateRotation
public bool UpdateRotationWhether it turns its entity to where it walks.
Destination
public Vector3 DestinationWhere it is sent, where NavMeshAgent3D.HasDestination says it is sent anywhere and NavMeshAgent3D.Target names nothing.
HasDestination
public bool HasDestinationWhether it is sent to NavMeshAgent3D.Destination.
Target
public EntityRef TargetAn entity it follows wherever that goes, before NavMeshAgent3D.Destination.
Stopped
public bool StoppedWhether it stands where it is, though it is sent somewhere.
AreaMask
public int AreaMaskThe areas it walks, a bit each, as Project Settings ▸ Navigation lists them: Walkable's the lowest; -1 for every one.
AutoTraverse
public bool AutoTraverseWhether it crosses a link by itself; off, it waits as it comes to one for the game's code to move it across.
Velocity
public Vector3 VelocityHow it moves, in meters a second each way: what a system moving its entity itself walks it at.
RemainingDistance
public float RemainingDistanceHow far it has left to walk along its path, in meters; 0 with nowhere to go.
Arrived
public bool ArrivedWhether it has come to where it was sent, within NavMeshAgent3D.StoppingDistance.
OnNavMesh
public bool OnNavMeshWhether it stands on the navmesh of its agent type; false where it was put where none is.
OnLink
public bool OnLinkWhether it is crossing a link, from the moment it comes to the link until it is on the far side. With NavMeshAgent3D.AutoTraverse off, the game's code clears it once the agent is across, and the agent walks on from where its entity is.
LinkProgress
public float LinkProgressHow far across the link it is, 0 at its start to 1 at its end: what an animator plays a jump by.
LinkStart
public Vector3 LinkStartThe end of the link it crosses from, on the navmesh, in the world.
LinkEnd
public Vector3 LinkEndThe end of the link it crosses to, on the navmesh, in the world.
