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

CharacterTrait

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

The carried state of a character the controller moves: what its last move left it standing on, how fast it 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 its landing. Its presence marks a character: an entity with it moves only through moveCharacter.