Vixen
c7401864
csharp
public sealed class MoveToTask

Walks to a key's position or entity, over the navmesh.

Read the guide page for this →

Remarks

doc 37 § Part 3's MoveTo. It writes a NavigationDestination and reads a NavigationState; the walking is NavigationSystem's and the crowd's. That split is what lets the task be twenty lines and what lets local avoidance, path slicing and off-mesh links keep working underneath it without the tree knowing.

⚠ An entity target is re-planned when it moves and a Vector3 one never is. Chasing something means the destination follows it, and is what keeps that from being a path search a frame: the target has to have actually gone somewhere before the search is worth repeating.

⚠ Aborting stops the agent where it stands. An abort is a higher-priority branch taking over, and an agent that kept walking to a destination its tree has forgotten about is the classic behaviour-tree bug — a guard that chases you while playing its idle.

Fields and properties (1)

  • public static int StateSize

    How many bytes it needs.

Methods (4)

  • public MoveToTask(BlackboardKey key, float acceptance = 1.5, float repath = 1)

    Walks to a key's position or entity, over the navmesh.

  • public void Start(in AgentContext context, Span<byte> state)

    Begins. Called once before the first Tick, on a zeroed span.

  • public ActionStatus Tick(in AgentContext context, Span<byte> state, float delta)

    Advances it.

  • public void Abort(in AgentContext context, Span<byte> state)

    Stops it early. The span is zeroed afterwards; this is for what is outside it.

Used by (4)

  • MoveToTestsVixen.Ai.Nodes.Tests
  • PatrolTaskVixen.Ai.Nodes
  • VillageVixen.Ai.Nodes.Tests
  • WorldNodesVixen.Ai.Nodes