Skip to main content

FirstPersonBehaviorOptions

@zylem/game-lib


@zylem/game-lib / behavior / FirstPersonBehaviorOptions

Interface: FirstPersonBehaviorOptions

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/first-person.d.ts:139

First-person controller behavior options (typed for entity.use() autocomplete).

Properties​

eyeHeight?​

optional eyeHeight?: 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/first-person.d.ts:147

Eye height offset above entity position (default: 1.7)


lookSensitivity?​

optional lookSensitivity?: 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/first-person.d.ts:145

Look sensitivity multiplier (default: 2)


perspective?​

optional perspective?: FirstPersonPerspective

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/first-person.d.ts:149

The FirstPersonPerspective to drive (from camera.getPerspective())


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/first-person.d.ts:143

Sprint/run speed (default: 16)


viewmodel?​

optional viewmodel?: 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/first-person.d.ts:151

Optional viewmodel (weapon/item) to position relative to the camera

cameraObject?​

optional cameraObject?: Object3D<Object3DEventMap>

Parent the viewmodel to this Object3D (e.g. the Three.js camera) for jitter-free follow.

entity​

entity: any

offset​

offset: Vec3Input

rotation?​

optional rotation?: Euler


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/first-person.d.ts:141

Base walking speed (default: 8)