Any NPCs · Documentation
Walking, Crossings and Traffic
How NPCs find their way along your roads, when they step onto the road, how the cars stop for them, and what happens when a car comes too close.
← All Any NPCs documentation1 · Walking lines
Routes built from your roads
When a road network loads in play, Any NPCs builds its walk graph from the same geometry Any City used for the road meshes. Nothing is placed by hand, and a regenerated city gets new lines on its own. The graph has:
- A walking line along each sidewalk, halfway across it by default.
- A line around every junction corner, following the curve of the corner sidewalk.
- A line over each painted crosswalk, stepping up and down raised medians.
- An unmarked crossing wherever an approach has sidewalks on both sides but no crosswalk (roundabouts, dead ends, two-road junctions), so NPCs are never trapped on one side. At a junction it lies between the junction and the stop line, in front of the waiting cars.
- Joins between road networks at their linked open ends.
Sidewalks narrower than 80 cm get no line. Very short segments, or a road network whose Stop Line Gap is under 90 cm, leave no room for an unmarked crossing in front of the cars and get none; the Output Log says so. The layout is project-wide:
▾ Project Settings > Plugins > Any NPC
2 · Walking
How they walk
Each NPC keeps its own side of the walking line (most keep right), slows down behind the person ahead, pauses now and then and, at each corner, mostly walks straight on. The walking settings are on the manager:
▾ AnyNpcManager > Simulation Settings > Walking
3 · Crossing
When they cross
An NPC walks to the curb, stops and waits until both of these are true:
- The light. The approach's signal is red for cars, with enough red left to walk across plus a safety margin. A road without a signal counts as red.
- The cars. No vehicle stands on the crossing, no moving vehicle within 15 m is heading for it or will reach it before the NPC is across, and no traffic car standing close by and facing it is next to go. Cars held at a red light of the junction are ignored: they stop behind the crossing.
Once it is clear, the NPC walks across a little faster. While NPCs are on the road, every traffic lane under the crossing is blocked: cars, turning cars included, stop short of it, and a car that can't stop in time brakes as hard as it can. NPCs that wait too long give up and walk elsewhere.
Streams of people don't stall the traffic. Others may join NPCs already crossing only within 3 seconds. After that, a waiting car goes first once the crossing empties, so a busy sidewalk holds a car for about one walk across.
▾ AnyNpcManager > Simulation Settings > Crossing
4 · Cars
Hits, knockdowns and dodges
Any City traffic, and any pawn moving faster than a walk, such as a player's car, is checked against the NPCs every frame:
- A vehicle that touches an NPC at 2.5 m/s or more knocks it down. Damage rises with speed, to a kill at 11 m/s. Slower contact is a bump.
- A knocked-down NPC becomes a ragdoll, lies for 4 seconds and gets up where it came to rest, playing its type's Get Up Montage if it has one.
- A dead NPC stays as a corpse for 20 seconds.
- NPCs already on the road run on or back when a car comes. A car mounting the sidewalk makes the NPCs in its path jump aside.
- Every hit is a Crash: people within 25 m react with their type's weights.
Ragdolls need a physics asset. The mannequin meshes use PA_Mannequin. Give your own meshes one too, or knocked-down NPCs can't fall.
▾ AnyNpcManager > Simulation Settings > Hits
Next: set how each kind of NPC looks, moves and reacts, and put your own characters on the street.