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

CharacterTrait

const CharacterTrait: Trait<{ airSeconds: number; externalVelocity: () => Vector3; floorNormal: () => Vector3; height: number; isGrounded: boolean; jumpsSinceGrounded: number; launchCount: number; platformVelocity: () => Vector3; standingOn: Entity | null; verticalSpeed: number; }>

The carried state of a character the controller moves: what her last move left her standing on, how fast she rises or falls, and what launches and shoves added. moveCharacter writes it, and so do teleport, addLinearVelocity and pushCharacter; a game reads it to draw or decide, such as a pose in the air or coyote time. Predicted, so a correction restores it as it restores any trait, and streamed to every page, so another player’s page plays her landing. Its presence marks a character: an entity with it moves only through moveCharacter.