Help support this project by starring the repo on GitHub!
Character Controller
state: booting
grounded: no
pointer lock: click canvas
speed: 0.00
position: 0.0, 0.0, 0.0
WASD move, Shift sprint, Space jump
Fullscreen + wheel zooms camera

Overview

This example uses a character controller inspired from Sketchbook's third-person controller, and uses their iconic boxman model.

How it works?

  • terrainQuery.sampleTerrain(x, z) for synchronous elevation and normal sampling
  • terrainRaycast.pick(ray) for downward terrain hit testing

That keeps the character grounded on the terrain.