Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit65083fe8f2

README.md

scene.spawns

The scene's spawn points. scene.player decides whether a scene spawns players and what they become; this decides where they arrive — the PlayerSpawn entities themselves.

With no argument it reports every spawn. "add" places one (an opts.position says where), "set" reconfigures one (opts.spawn names it, opts.rotation turns it) and "remove" deletes one.

What a spawn decides

  • Its transform — where a joining player's body lands while placement is at_spawn_transform, and its forward axis is the direction they face. The edit-mode debug overlay draws that as a ring, a heading arrow and a standing capsule, so a spawn is visible where it stands.
  • Its prototype — which PlayerPrototype subtree gets instantiated for the joining user. A spawn whose prototype is unset or no longer resolves cannot spawn anyone; the report says so (prototypeResolves) and the overlay draws it red. In play the scene holds the prototype as the captured template each joining player is cloned from, and the spawn's prototype resolves to that template.
  • team / role / maxPlayers / spawnPolicy — the PlayerSpawn component's own fields, carried onto the players it spawns.

Picking a spawn

opts.spawn names the spawn to act on, by name or id. With one spawn in the scene it is implied; with several it is required, and an unmatched name is an error listing what the scene has. On "add" the same field names the new entity instead.

New spawns are parented alongside the spawns already in the scene (else under the scene's Spawns container), so spawn points stay collected in one place. Mutating saves the scene.