Ara
Download

Search or run a command

Jump to a section or open an Ara link.

Component · gameplay

Wanderer

Server-side AI: walks the navmesh to random points inside a box, pausing between.

Fields

min

vec3
Minimum corner of the roaming box (world space).
default [0,0,0]m

max

vec3
Maximum corner of the roaming box (world space).
default [0,0,0]m

pauseTicks

u32
Ticks to wait after arriving before choosing the next goal.
default 45

resumeTick

u64
Tick at which the next goal is chosen. Simulation state.
default 0

goals

u32
Goals chosen so far. Simulation state.
default 0

Usage

Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.

Add it

ara do component.add -p entity=name:Crate -p component=Wanderer --why "Add Wanderer"

Set a field

ara do property.set -p entity=name:Crate -p path=Wanderer.min -p value=[0,0,0] --why "Tune Wanderer"

In a scene document

{
  "Wanderer": {
    "min": [
      0,
      0,
      0
    ]
  }
}

From C#

/// <summary>Let a wandering NPC pause for two seconds at 60 Hz.</summary>
public static void UseWanderer(Entity entity, in Tick tick)
{
    ref var component = ref World.Get<Wanderer>(entity);
    component.PauseTicks = 120;
}

From C#

Scripts read and write it with Get<Wanderer>(); see the Wanderer struct.