Talos docs

controller

Since 0.6Changed in 0.7
Plain text

Use it in a scene entity's components list as { "type": "controller", … }. The contract writes the fields flat and refuses unknown keys.

Fields

FieldTypeRequiredDefaultAllowed valuesDescription
kindControllerKindyesplayer
speednumberyes
jumpnumberyes
crouchbooleanno
inputControllerInputModenoauto, scriptWho drives the controller. auto (the default): the engine feeds the player's move, jump, crouch and look actions into it every tick, from the devices and POST /input, before behaviours run. script: the engine writes nothing to it, and a behaviour owns it through ctx.controller.
inputBasisControllerInputBasisnoworld, controller, cameraFor auto input only: the frame the move stick is read in. camera (the default): the rendered view's heading, so forward is away from the camera and right is screen-right; with no camera, world -Z. world: forward is world -Z. controller: the controller's heading, which look turns.
gravitynumbernoDownward acceleration in m/s², 0 or more. Default: the length of the scene's meta.gravity. ctx.controller.gravityScale multiplies it.
maxFallSpeednumberno55Terminal velocity: the fastest the character falls, in m/s, more than 0. Default 55.
accelnumberno50Ground acceleration, m/s², above 0. Default 50.
decelnumbernoGround braking, m/s², above 0. Default: accel.
turnRatenumberno720Root-motion turn rate, deg/s, above 0. Default 720.
stepnumberno0Tallest ledge the character walks up without jumping, in metres: more than 0 and under 1.8, the character's standing height. Default 0.3. The navmesh the playtester, the critic and POST /path route on is fitted to the same number.

Rules that can refuse it

Example

From the contract's tested fixture fixtures/contract/full20/scene.json#player.

{
  "type": "controller",
  "kind": "player",
  "speed": 3.2,
  "jump": 4.5,
  "crouch": true
}