Ara
Download

Search or run a command

Jump to a section or open an Ara link.

Component · physics

CharacterController

Predicted capsule movement: slopes, stairs, moving platforms, crouching and pushing.

Fields

radius

f32
Standing capsule radius.
default 0.3m≥ 0.001

height

f32
Complete standing height; must exceed twice the radius.
default 1.8m≥ 0.001

crouchHeight

f32
Complete crouched height, between diameter and standing height.
default 1m≥ 0.001

maxSlopeDeg

f32
Maximum walkable slope angle.
default 45deg0.1 – 89.9

stepHeight

f32
Maximum stair step height.
default 0.35m≥ 0

stickDown

f32
Distance searched below feet to stay on a descending surface.
default 0.5m≥ 0

padding

f32
Capsule collision padding.
default 0.02m≥ 0

maxStrength

f32
Maximum force used to push rigid bodies.
default 1000N≥ 0

mass

f32
Character mass used for dynamic body interaction.
default 70kg≥ 0.001

layer

u32
Collision 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.