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

BodyVelocityTrait

const BodyVelocityTrait: CoreTrait<() => BodyVelocity>

A kinematic or dynamic body’s velocity and sleep, which the world that simulates it writes after each physics step and the room streams to every page: each awake body’s every send, and a sleeping body’s once. readLinearVelocity, readAngularVelocity and isSleeping read it on a page for a body the room simulates, and Rapier on the world that simulates it. Separate from VelocityTrait, which core.move moves an entity with no body by. Read-only to a game by type.