Scripting API
Scripting API
NavMeshAgent2D
Struct in Abyss.Navigation, from Abyss.Navigation.
Something that walks a navmesh in 2D while the game plays: sent to NavMeshAgent2D.Destination, or after NavMeshAgent2D.Target, it walks there around walls, obstacles and other agents at its NavMeshAgent2D.Speed, moving its entity along X and Y. What it does is in its fields as it goes: NavMeshAgent2D.Velocity, NavMeshAgent2D.RemainingDistance, NavMeshAgent2D.Arrived.
public struct NavMeshAgent2DRemarks
Of an agent type, as Project Settings ▸ Navigation lists them: its radius is the agent's, and it walks the navmesh of a NavMeshSurface2D baked for that type.
Only while the game plays: edited, it stands where it is put.
Constructors
NavMeshAgent2D
public NavMeshAgent2D()Of the first agent type, sent nowhere, moving its entity and leaving it turned as it is.
Fields
AgentType
public int AgentTypeWhich agent type it is: its place in Project Settings ▸ Navigation.
Speed
public float SpeedHow fast it walks, in units a second.
AngularSpeed
public float AngularSpeedHow fast it turns to where it walks, in degrees a second, where it turns.
Acceleration
public float AccelerationHow fast it gets up to speed, and slows down, in units a second each second.
StoppingDistance
public float StoppingDistanceHow near where it is sent it stops.
AutoBraking
public bool AutoBrakingWhether it slows as it comes to where it is sent.
Avoidance
public NavMeshAvoidance2D AvoidanceHow well it steers around other agents and moving obstacles.
Priority
public int PriorityHow readily it gives way, 0 to 99: one numbered higher steps aside more for one numbered lower.
UpdatePosition
public bool UpdatePositionWhether it moves its entity; off, it only steers, and something else moves the entity by its velocity.
UpdateRotation
public bool UpdateRotationWhether it turns its entity about Z so the entity's up points the way it walks.
Destination
public Vector2 DestinationWhere it walks to, in world space, while NavMeshAgent2D.HasDestination is on and NavMeshAgent2D.Target names nothing.
HasDestination
public bool HasDestinationWhether it walks to NavMeshAgent2D.Destination.
Target
public EntityRef TargetAn entity it follows wherever that goes; while one is named, NavMeshAgent2D.Destination is not walked to.
Stopped
public bool StoppedWhether it stands where it is, though it is sent somewhere.
AreaMask
public int AreaMaskThe areas it walks, a bit each by their place in Project Settings ▸ Navigation: every one to begin with.
AutoTraverse
public bool AutoTraverseWhether it crosses a link by itself; off, it stops as it comes to one and waits for the game's code.
Velocity
public Vector2 VelocityHow fast and which way it walks now, in units a second.
RemainingDistance
public float RemainingDistanceHow far it has left to walk to where it is sent.
Arrived
public bool ArrivedWhether it came to where it was sent, and stopped there.
OnNavMesh
public bool OnNavMeshWhether it stands on a navmesh of its type.
OnLink
public bool OnLinkWhether it is on a link: set as it starts across, and cleared as it lands, or by the game's code that moved it across.
LinkProgress
public float LinkProgressHow far across its link it is, 0 to 1.
LinkStart
public Vector2 LinkStartWhere the link it crosses starts, in world space.
LinkEnd
public Vector2 LinkEndWhere the link it crosses ends, in world space.
