Skip to main content

Platformer2DBehaviorOptions

@zylem/game-lib


@zylem/game-lib / behavior / Platformer2DBehaviorOptions

Interface: Platformer2DBehaviorOptions

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:159

Platformer 2D behavior options (typed for entity.use() autocomplete)

Properties​

autostep?​

optional autostep?: false | \{ maxHeight: number; minWidth: number; \}

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:181

Autostep over small step-ups, or false to disable (default: { maxHeight: 0.25, minWidth: 0.05 })


characterOffset?​

optional characterOffset?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:188

Character controller collision offset (default: 0.05)


coyoteTime?​

optional coyoteTime?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:171

Coyote time in seconds (default: 0.1)


gravity?​

optional gravity?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:169

Gravity force (default: 20)


jumpBufferTime?​

optional jumpBufferTime?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:173

Jump buffer time in seconds (default: 0.1)


jumpCutMultiplier?​

optional jumpCutMultiplier?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:175

Velocity multiplier when releasing jump early (default: 0.5)


jumpForce?​

optional jumpForce?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:165

Initial jump force (default: 12)


maxJumps?​

optional maxJumps?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:167

Maximum number of jumps (default: 1)


runSpeed?​

optional runSpeed?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:163

Sprint/run speed (default: 14)


shape?​

optional shape?: object

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:190

Explicit KCC capsule override (requires useAttachedCollider: false).

halfHeight​

halfHeight: number

offset?​

optional offset?: [number, number, number]

radius​

radius: number


slopeClimbAngle?​

optional slopeClimbAngle?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:177

Maximum slope angle in degrees the character can walk up (default: 50)


slopeSlideAngle?​

optional slopeSlideAngle?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:179

Slope angle in degrees past which the character slides (default: 40)


snapToGroundDistance?​

optional snapToGroundDistance?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:186

Snap-to-ground distance for downhill/step-down stability (default: 0.2)


useAttachedCollider?​

optional useAttachedCollider?: boolean

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:196

When true (default), KCC reads shape + offset from the attached Rapier collider.


walkSpeed?​

optional walkSpeed?: number

Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/platformer-2d.d.ts:161

Base walking speed (default: 8)