Three.js from Zero to Senior · Part 18 — Interaction: Raycasting, Click-to-Move & a Character State Machine
Turn taps into 3D intent. Raycast to pick the character or the ground, move with click-to-move, face the travel direction, and wire a tiny state machine that drives Idle ⇄ Walk ⇄ Run cross-fades — coexisting with OrbitControls. Live demo.