component

Player

First/third-person character controller (ecctrl wrapper). WASD moves; mouse-drag or the arrow keys steer the camera in either view. Reads the world's `avatar` setting for its default view and the world's `controls` for key bindings.

⌖ Explore the library in 3D →

First-person controller — drop it into a world to walk.

Add it

npx @runek/cli add player

Pulls @react-three/drei@^10.7.7, @react-three/fiber@^9.6.1, @runek/core@^0.13.0, ecctrl@^1.0.97, three@^0.184.0.

Use it

import { Player } from './runek/Player'

<Player position={[0, 0, 0]} />

Props

export interface PlayerProps {
  position?: Vec3
  /** Camera view. Unset defers to the world default (`<World avatar>`); falls back
   *  to first-person. An explicit value here always wins. */
  view?: PlayerView
  /** Initial camera yaw in radians (0 faces +z). */
  yaw?: number
  /** Custom avatar visual, replacing the default capsule. Size it to the capsule
   *  envelope (~1.3 units tall, centered at the character origin); it is hidden in
   *  first-person view. In world JSON, nest it as a child node of the Player. */
  children?: ReactNode
}

Registry manifest

registry manifest /r/components/player.json Self-contained JSON: inlined source plus resolved dependencies, exactly what runek add player fetches.

Browse the whole catalog in the gallery →.