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 her rising speed and lifts her off the floor, as Unreal’s LaunchCharacter does, and its sideways part to her 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 her page’s correction knows a shove arrived. Her 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);