Ara
Download

Search or run a command

Jump to a section or open an Ara link.

Component · gameplay

PlayerControl

Drives this entity's CharacterController from Move, Sprint and Jump, relative to its camera rig's yaw.

Fields

player

u64
Input owner (PlayerId).
default 1

walkSpeed

f32
Walking speed.
default 1.6m/s≥ 0

runSpeed

f32
Sprinting speed.
default 4.5m/s≥ 0

jumpSpeed

f32
Jump launch speed.
default 4.5m/s≥ 0

turnRate

f32
Maximum turn rate toward the movement direction.
default 540deg/s≥ 0

yaw

f32
Facing yaw; 0 faces +Z. Simulation state.
default 0deg

camera

option<entity>
Camera rig whose yaw orients Move; world axes when empty.
default null

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=PlayerControl --why "Add PlayerControl"

Set a field

ara do property.set -p entity=name:Crate -p path=PlayerControl.player -p value=1 --why "Tune PlayerControl"

In a scene document

{
  "PlayerControl": {
    "player": 1
  }
}

From C#

/// <summary>Increase the player sprint speed.</summary>
public static void UsePlayerControl(Entity entity, in Tick tick)
{
    ref var component = ref World.Get<PlayerControl>(entity);
    component.RunSpeed = 7f;
}

From C#

Scripts read and write it with Get<PlayerControl>(); see the PlayerControl struct.