Skip to content

Variable: LocomotionEnvironment

const LocomotionEnvironment: Component<{ _envHandle: { default: number; type: Float32; }; _initialized: { default: false; type: Boolean; }; type: { default: any; enum: any; type: Enum; }; }>

Defined in: packages/core/src/locomotion/locomotion.ts:33

Marks an entity's object3D hierarchy as walkable environment for the locomotion engine.

Remarks

  • Set EnvironmentType to STATIC for fixed geometry (merged once) or KINEMATIC for moving platforms (matrices streamed each frame via LocomotionSystem.update).
  • Attach this component to the environment root you want the player to stand on.

Example

ts
const floor = world.createTransformEntity(gltf.scene);
floor.addComponent(LocomotionEnvironment, { type: EnvironmentType.STATIC });