moveCharacter
Call Signature
Section titled “Call Signature”moveCharacter(
step,character,options):Readonly<MoveCharacterResult>
Moves character by velocity for one tick through the engine’s
character controller. It 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, and crouches under a bar where
overrides.height lowers it. On the room it pushes the dynamic bodies
it walks into. Its body is placed at once, so a later mover this tick
meets it where it now stands. A held push from pushCharacter holds its
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 the player’s page and in a re-run, where it pushes nothing.
In a predicted system it 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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
step |
PredictedStep |
character |
PredictedEntity |
options |
MoveCharacterOptions |
Returns
Section titled “Returns”Readonly<MoveCharacterResult>
Example
Section titled “Example”moveCharacter(step, character, { velocity: desired, jump: canJump });Call Signature
Section titled “Call Signature”moveCharacter(
step,character,options):Readonly<MoveCharacterResult>
Moves character by velocity for one tick through the engine’s
character controller. It 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, and crouches under a bar where
overrides.height lowers it. On the room it pushes the dynamic bodies
it walks into. Its body is placed at once, so a later mover this tick
meets it where it now stands. A held push from pushCharacter holds its
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 the player’s page and in a re-run, where it pushes nothing.
In a predicted system it 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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
step |
AuthoritativeStep |
character |
Entity |
options |
MoveCharacterOptions |
Returns
Section titled “Returns”Readonly<MoveCharacterResult>
Example
Section titled “Example”moveCharacter(step, character, { velocity: desired, jump: canJump });