Skip to content

five-on-it / packages/sim/src/pedestrians / spawnPedestrian

Function: spawnPedestrian() ​

spawnPedestrian(sim, x, z, y?, roam?, start?): number

Defined in: packages/sim/src/pedestrians.ts:236

Spawns a pedestrian standing at (x, y, z) and returns its entity id; with roam false it is a range dummy that stays at its post. Given a start on the pavements it walks them in its role from that node (a shopkeeper at its door, which is its home: where it respawns); otherwise it wanders off them.

Parameters ​

sim ​

SimWorld

x ​

number

z ​

number

y? ​

number = 1

roam? ​

boolean = true

start? ​

PavementStart

Returns ​

number