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

moveCharacter

moveCharacter(step, character, options): Readonly<MoveCharacterResult>

Moves character by velocity for one tick through the engine’s character controller: she steps onto kerbs, stands on slopes and slides off steep ones, snaps down onto a floor at the top of a ramp, rides a moving platform, falls under gravity, crouches under a bar where overrides.height lowers her, and pushes the dynamic bodies she walks into on the room. Her body is placed at once, so a later mover this tick meets her where she now stands. A held push from pushCharacter holds her horizontal velocity whatever velocity asks, and counts down after the move. Once a tick: a second call in one pass throws in development and in a deployed world returns the first call’s result. Runs the same on the room, on her page and in a re-run, where it pushes nothing. In a predicted system she is the PredictedEntity the step handed out; on the room’s step any character, such as an NPC. As Unity’s CharacterController.Move and Unreal’s CharacterMovementComponent, with the game’s movement computing the velocity.

Parameter Type
step PredictedStep
character PredictedEntity
options MoveCharacterOptions

Readonly<MoveCharacterResult>

moveCharacter(step, character, { velocity: desired, jump: canJump });

moveCharacter(step, character, options): Readonly<MoveCharacterResult>

Moves character by velocity for one tick through the engine’s character controller: she steps onto kerbs, stands on slopes and slides off steep ones, snaps down onto a floor at the top of a ramp, rides a moving platform, falls under gravity, crouches under a bar where overrides.height lowers her, and pushes the dynamic bodies she walks into on the room. Her body is placed at once, so a later mover this tick meets her where she now stands. A held push from pushCharacter holds her horizontal velocity whatever velocity asks, and counts down after the move. Once a tick: a second call in one pass throws in development and in a deployed world returns the first call’s result. Runs the same on the room, on her page and in a re-run, where it pushes nothing. In a predicted system she is the PredictedEntity the step handed out; on the room’s step any character, such as an NPC. As Unity’s CharacterController.Move and Unreal’s CharacterMovementComponent, with the game’s movement computing the velocity.

Parameter Type
step AuthoritativeStep
character Entity
options MoveCharacterOptions

Readonly<MoveCharacterResult>

moveCharacter(step, character, { velocity: desired, jump: canJump });