Skip to content

CharacterController2DData

Defined in: physics/CharacterController2D.ts:32

The fields of the CharacterController2D component, whose tier this shape carries.

floorMaxAngle: number

Defined in: physics/CharacterController2D.ts:38

Max walkable slope, measured from up (radians). Steeper = wall.


floorNormal: Vec2

Defined in: physics/CharacterController2D.ts:57

Output: normal of the last floor touched (zero when airborne).


isOnCeiling: boolean

Defined in: physics/CharacterController2D.ts:55

Output: touched a surface classified as ceiling this move.


isOnFloor: boolean

Defined in: physics/CharacterController2D.ts:51

Output: touched a surface classified as floor this move.


isOnWall: boolean

Defined in: physics/CharacterController2D.ts:53

Output: touched a surface classified as wall this move.


maskBits: number

Defined in: physics/CharacterController2D.ts:48

Collision layers that block the character.


maxSlides: number

Defined in: physics/CharacterController2D.ts:40

Slide iterations per move (corners need more than one).


realVelocity: Vec2

Defined in: physics/CharacterController2D.ts:59

Output: actual displacement / dt after collisions (pixels/second).


skinWidth: number

Defined in: physics/CharacterController2D.ts:42

Gap kept from surfaces (pixels) so the body doesn’t stick/jitter.


slideOnCeiling: boolean

Defined in: physics/CharacterController2D.ts:46

When false, a ceiling hit stops the remaining move instead of sliding along it.


snapLength: number

Defined in: physics/CharacterController2D.ts:44

Down-probe length (pixels) to stay glued to floors on slopes/stairs; 0 = off.


up: Vec2

Defined in: physics/CharacterController2D.ts:36

Up direction for floor/ceiling classification (opposes gravity).


velocity: Vec2

Defined in: physics/CharacterController2D.ts:34

Desired velocity in world pixels/second; set it from gameplay each step.