Skip to content

PlatformerController2DData

Defined in: sdk/src/physics/PlatformerController2D.ts:14

The fields of the PlatformerController2D component.

airAcceleration: number

Defined in: sdk/src/physics/PlatformerController2D.ts:19


airDeceleration: number

Defined in: sdk/src/physics/PlatformerController2D.ts:22


airJumps: number

Defined in: sdk/src/physics/PlatformerController2D.ts:38

Extra jumps before landing again.


coyoteTime: number

Defined in: sdk/src/physics/PlatformerController2D.ts:34

Seconds after leaving the ground that a jump still counts as from the ground.


dropPressed: boolean

Defined in: sdk/src/physics/PlatformerController2D.ts:52

Input: ask to drop through a one-way platform. Consumed by the next fixed step.


dropTime: number

Defined in: sdk/src/physics/PlatformerController2D.ts:40

Seconds a drop through a one-way platform lasts.


enabled: boolean

Defined in: sdk/src/physics/PlatformerController2D.ts:53


fallGravityScale: number

Defined in: sdk/src/physics/PlatformerController2D.ts:26

Gravity multiplier while falling. Above 1 lands faster than it rose, which reads as weight.


gravity: number

Defined in: sdk/src/physics/PlatformerController2D.ts:24

Downward acceleration, world pixels per second squared.


groundAcceleration: number

Defined in: sdk/src/physics/PlatformerController2D.ts:18

How fast it reaches that speed on the ground, and in the air.


groundDeceleration: number

Defined in: sdk/src/physics/PlatformerController2D.ts:21

How fast it sheds it when the stick centres, on the ground and in the air.


jumpBuffer: number

Defined in: sdk/src/physics/PlatformerController2D.ts:36

Seconds a jump pressed too early is remembered, to happen on landing.


jumpCut: number

Defined in: sdk/src/physics/PlatformerController2D.ts:32

How much of a rising speed survives letting go of jump, 0..1. 1 makes every jump full height.


jumpHeld: boolean

Defined in: sdk/src/physics/PlatformerController2D.ts:48

Input: the jump button is down.


jumpPressed: boolean

Defined in: sdk/src/physics/PlatformerController2D.ts:50

Input: the jump button went down. Consumed by the next fixed step.


jumpSpeed: number

Defined in: sdk/src/physics/PlatformerController2D.ts:30

Upward speed a jump starts with; 0 disables jumping.


keepPlatformVelocity: boolean

Defined in: sdk/src/physics/PlatformerController2D.ts:42

A jump keeps the velocity of the platform it left.


maxFallSpeed: number

Defined in: sdk/src/physics/PlatformerController2D.ts:28

The fastest it falls.


moveInput: number

Defined in: sdk/src/physics/PlatformerController2D.ts:46

Input: -1 left to 1 right.


moveSpeed: number

Defined in: sdk/src/physics/PlatformerController2D.ts:16

Top running speed, world pixels per second.


readKeyboard: boolean

Defined in: sdk/src/physics/PlatformerController2D.ts:44

Read the keyboard itself. Off, a game or an AI writes moveInput, jumpHeld, jumpPressed and dropPressed.