Skip to content

Patrol AI

Patrol AI is a controlled movement component for simple enemies, hazards, and moving characters. It runs in the shared deterministic runtime and does not require custom code.

Add a patrol

  1. Open Pieces and add Patrol enemy, or attach Patrol AI to a non-player object.
  2. Choose a horizontal or vertical axis.
  3. Set the total distance between the two endpoints and movement speed.
  4. Choose whether movement starts in the positive or negative direction.
  5. Run Test Rift to check the route and collisions.

The object's starting Transform is the center of its route. For example, a horizontal distance of 160 moves 80 units left and 80 units right of the start.

Requirements and limits

  • Patrol AI requires Transform, Rigidbody, and Collider components. Workshop adds missing components when you attach Patrol AI.
  • A Player-controlled object cannot also have Patrol AI.
  • Distance is 1–4096 world units and speed is 1–1000 units per second.
  • Set Rigidbody gravity to zero for a floating patrol. A horizontal ground enemy can use gravity when the level provides supporting collision geometry.
  • The authoritative runtime owns direction and velocity. The browser does not submit NPC decisions.

Patrol AI is intentionally small. It does not yet provide pursuit, pathfinding, vision, combat, health, teams, or behavior trees.

PixelRifts creator documentation · generated reference · protocol 21