Component · gameplay
Wanderer
Server-side AI: walks the navmesh to random points inside a box, pausing between.
Fields
min
vec3Minimum corner of the roaming box (world space).
default [0,0,0]m
max
vec3Maximum corner of the roaming box (world space).
default [0,0,0]m
pauseTicks
u32Ticks to wait after arriving before choosing the next goal.
default 45
resumeTick
u64Tick at which the next goal is chosen. Simulation state.
default 0
goals
u32Goals 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.