Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

characters

const characters: PluginFactory<[CharactersOptions & object], PluginMade<readonly [SystemDefinition<"input", true, Both, "walk">, SystemDefinition<"rules", false, Server, "teamChange">, SystemDefinition<"rules", false, Server, "respawn">, SystemDefinition<"physics", true, Both, "outOfWorld">, SystemDefinition<"physics", true, Both, "aim">, SystemDefinition<"physics", false, Server, "npcMovement">, SystemDefinition<"physics", true, Both, "movement">, SystemDefinition<"physics", true, Both, "countDown">], CharacterInputDeclarations, Readonly<Record<never, never>>, "players" | "npcs", { stop: CommandDeclaration<{ }, WalkRefusal, undefined, true, false, true, false>; walk: CommandDeclaration<{ to: Vector3CommandField; }, WalkRefusal, undefined, true, false, true, false>; }, { walking: InputContextDeclaration; }, { respawnPoint: SaveDeclaration<ZodMiniObject<{ point: ZodMiniNullable<ZodMiniObject<{ facing: ZodMiniNullable<ZodMiniNumber<…>>; position: ZodMiniObject<{ x: …; y: …; z: …; }, $strip>; scene: ZodMiniString<string>; team: ZodMiniNullable<ZodMiniString<…>>; world: ZodMiniString<string>; worldReset: ZodMiniInt; }, $strip>>; }, $strip>, readonly ["player"], readonly []>; }>>

The characters: each one’s movement on its input or along its path, its pushes and speed modifiers, and the character each player gets as the player joins a room. A game whose players walk lists it; a game whose players control something else, or nothing, lists none.

It declares the six inputs a character steps on, which a system reads with readInput(character, characters.inputs.move): move, a vector on W, A, S and D and the arrows; heading and pitch, angles the page’s camera sets; strafe, a button the camera’s lock holds; jump, an edge button on Space; and aim, a vector in world axes that setPlayerAim, keys or a stick fill.