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

addLinearVelocity

addLinearVelocity(authority, entity, velocity): void

Adds velocity, in metres a second, to how fast entity moves, on the room’s step: a knockback, a launch pad, an explosion’s shove. On a character, its upward part adds to its rising speed and lifts it off the floor, as Unreal’s LaunchCharacter does, and its sideways part to its externalVelocity, which decays on the floor by the controller’s groundFriction. On a body moveAndSlide moves, it waits in AddedVelocityTrait until the body’s next tick’s first move reports it as addedVelocity, for the kit to fold into its own velocity. On a dynamic body it changes Rapier’s velocity at once. Each call counts on the trait’s launchCount, so the player’s page’s correction knows a shove arrived. The player’s page hears of it a round trip later, as a correction.

Parameter Type
authority EntityAuthority | AuthoritativeStep
entity Entity
velocity Vector3Like

void

addLinearVelocity(step, hit.entity, shove);