Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

debug_player

The "player" provider for @builtin::modules.debugViz: draws the player-setup entities that carry no geometry of their own. The debug-viz driver registers it; the ambient edit-mode overlay draws it with no per-entity setup.

What it draws

A PlayerSpawn is a transform that decides where a joining player appears and which way they face, so its gizmo draws exactly that:

  • a player icon billboard at head height — findable from anywhere in the scene, at a constant on-screen size,
  • a ring on the spawn plane, marking the point itself,
  • an arrow along the spawn's forward axis — the heading a spawned body takes,
  • a capsule the size of a standing player (1.8m, feet on the spawn plane), so the room a body needs is visible against the geometry around it,
  • a faint line to the prototype the spawn instantiates.

A PlayerPrototype root draws its own icon, above the spawn's — a prototype is routinely authored at the same point as the spawn that instantiates it, so the two markers stack instead of hiding one another.

Colours match each component's edit-mode outline — orange for a spawn, cyan for a prototype.

A spawn draws red when it cannot instantiate anyone: prototype unset, naming an entity that has left the scene, or naming one that is not marked PlayerPrototype. Those are the three conditions the spawn's own setup validation reports, so a broken player setup reads from across the scene rather than only from the component's error channel.

API

  • debug_player.tick(emit) — draw every PlayerSpawn and PlayerPrototype in the scene into the shared batch.
  • debug_player.available() — whether the scene holds a player setup at all. The toggle panel offers the "Player spawns" category while this is true.