Skip to main content

NavPathFollower

Tracks progress along a NavPath. Call Update each tick and steer towards the point it returns with Bots.SetMoveInput.

public sealed class NavPathFollower

Namespace: DeadworksManaged.Api
Source: Nav.cs#L50

Notes​

A waypoint counts as reached within ArriveRadius on the ground plane, or once passed. The follower doesn't re-path. Find a new path when DistanceFromPath grows.

Constructors​

new NavPathFollower()​

Signature

public NavPathFollower(NavPath path, float arriveRadius = 40f)

Parameters

  • path: Path to follow.
  • arriveRadius: Distance that counts as reaching a waypoint.

Source: Nav.cs#L53

Properties​

NavPathFollower.Path​

Path being followed.

Signature

public NavPath Path { get; }

Source: Nav.cs#L60

NavPathFollower.ArriveRadius​

Distance that counts as reaching a waypoint.

Signature

public float ArriveRadius { get; set; }

Source: Nav.cs#L63

NavPathFollower.Index​

Index in NavPath.Waypoints of the next waypoint.

Signature

public int Index { get; }

Source: Nav.cs#L66

NavPathFollower.IsFinished​

True once the last waypoint is reached.

Signature

public bool IsFinished { get; }

Source: Nav.cs#L69

NavPathFollower.Target​

Next waypoint, or null once finished.

Signature

public NavWaypoint? Target { get; }

Source: Nav.cs#L72

Methods​

NavPathFollower.Update()​

Skips reached waypoints and returns the next one's position, or null at the end.

Signature

public Vector3? Update(Vector3 position)

Source: Nav.cs#L75

NavPathFollower.ShouldJump()​

True when the next waypoint is close, more than a step up, and reached by a jump or climb.

Signature

public bool ShouldJump(Vector3 position, float within = 160f)

Source: Nav.cs#L97

NavPathFollower.DistanceFromPath()​

Ground-plane distance from position to the leg being walked.

Signature

public float DistanceFromPath(Vector3 position)

Source: Nav.cs#L104