Component · physics
CharacterController
Predicted capsule movement: slopes, stairs, moving platforms, crouching and pushing.
Fields
radius
f32Standing capsule radius.
default 0.3m≥ 0.001
height
f32Complete standing height; must exceed twice the radius.
default 1.8m≥ 0.001
crouchHeight
f32Complete crouched height, between diameter and standing height.
default 1m≥ 0.001
maxSlopeDeg
f32Maximum walkable slope angle.
default 45deg0.1 – 89.9
stepHeight
f32Maximum stair step height.
default 0.35m≥ 0
stickDown
f32Distance searched below feet to stay on a descending surface.
default 0.5m≥ 0
padding
f32Capsule collision padding.
default 0.02m≥ 0
maxStrength
f32Maximum force used to push rigid bodies.
default 1000N≥ 0
mass
f32Character mass used for dynamic body interaction.
default 70kg≥ 0.001
layer
u32Collision group used for movement queries.
default 11 – 15
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=CharacterController --why "Add CharacterController"Set a field
ara do property.set -p entity=name:Crate -p path=CharacterController.radius -p value=0.3 --why "Tune CharacterController"In a scene document
{
"CharacterController": {
"radius": 0.3
}
}From C#
/// <summary>Allow a character to climb a shallow stair.</summary>
public static void UseCharacterController(Entity entity, in Tick tick)
{
ref var component = ref World.Get<CharacterController>(entity);
component.StepHeight = 0.4f;
}From C#
Scripts read and write it with Get<CharacterController>(); see the CharacterController struct.