Defaultcontrolparams

DefaultControlParams interface

Signature:

export interface DefaultControlParams 

Properties

Property

Modifiers

Type

Description

animations

{ idle: string; run: string; sprint: string; jump_idle: string; jump_walking: string; jump_sprinting: string; jump_running: string; falling: string; drop_idle: string; drop_walking: string; drop_walking_roll: string; drop_running: string; drop_running_roll: string; drop_sprinting: string; drop_sprinting_roll: string; walk: string; jump_double: string; }

Animations to be used by the character

autoAnimate?

boolean

(Optional) whether to automatically apply the corresponding animation to the attached object This applies only when the attached object is an avatar component

character?

typeof DEFAULT_CC_OPTIONS

(Optional) The character options for the kinematic character

gravity?

number

(Optional) The gravity of the scene

jump?

{ height?: number; duration?: number; airAcceleration?: number; hold?: boolean; max?: number; coyote?: number; maxFallSpeed?: number; peakSpeed?: number; delay?: number; }

(Optional) Params to controls the jump of the character of the target object

  • height: the height of the jump

  • duration: the duration of the jump

  • airAcceleration: the acceleration of the jump

  • hold: whether to hold the jump key to keep the jump going

  • max: the maximum number of jumps

  • coyote: the time in seconds after the character has left the ground that the character can still jump - Infinity by default

  • maxFallSpeed: the maximum speed the character can fall

  • peakSpeed: the speed at which the character reaches the peak of the jump

  • delay: the delay in seconds before the character can jump again

run?

{ speed?: number; boost?: number; accelerationFactor?: number; decelerationFactor?: number; }

(Optional) Params to controls walking and running of the target object

  • speed : the walking speed of the character

  • boost: how much to speedup the character when running, this is activated when the user presses the shift key

  • accelerationFactor: the acceleration of the character. 0 means no acceleration

  • decelerationFactor: the deceleration of the character. 0 means no deceleration