Component · physics
CharacterInput
Per-tick character intent: replay this input exactly once before the rigid-body step.
Fields
desiredVelocity
vec3Desired world-space horizontal velocity; Y must be zero.
default [0,0,0]m/sreplicated · owner, rollback
jumpSpeed
f32Jump launch speed; zero means no jump this tick.
default 0m/s≥ 0replicated · owner, rollback
crouch
boolRequested crouch; standing may be blocked by clearance.
default falsereplicated · owner, rollback
Usage
Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.
Add it
ara do component.add -p entity=name:Crate -p component=CharacterInput --why "Add CharacterInput"Set a field
ara do property.set -p entity=name:Crate -p path=CharacterInput.desiredVelocity -p value=[0,0,0] --why "Tune CharacterInput"In a scene document
{
"CharacterInput": {
"desiredVelocity": [
0,
0,
0
]
}
}From C#
/// <summary>Move a character along the ground this fixed tick.</summary>
public static void UseCharacterInput(Entity entity, in Tick tick)
{
ref var component = ref World.Get<CharacterInput>(entity);
component.DesiredVelocity = new Vector3(2, 0, 0);
}From C#
Scripts read and write it with Get<CharacterInput>(); see the CharacterInput struct.