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

readLinearVelocity

readLinearVelocity(world, entity): Readonly<Vector3>

entity’s velocity in metres a second, written into one vector reused by every call: copy it to keep it. Rapier’s on the world that simulates the body, and the stream’s on a page for a body the room simulates; zero for a fixed body and one not stepped yet.

Parameter Type
world World
entity Entity

Readonly<Vector3>

const speed = readLinearVelocity(world, ball).length();