hh-hang/three-player-controller — reverse-engineered prompt
Reverse engineered prompt
Build me a lightweight three.js player controller package with a working demo scene.
I want to be able to drop it into a three.js project, load a character model, and get normal game movement right away. The player should walk, run, jump, collide with the world, switch between first person and third person, and avoid the camera clipping through walls. It should also support flying mode, mobile touch controls, and optional vehicle control where the character can get in and out of a car.
Please include a demo page that shows the normal character controller, flying, vehicle driving, and mobile controls. The demo should use simple keyboard controls like WASD, Shift, Space, V for view switching, F for flying, and E for vehicle enter or exit.
Expose a clean JavaScript API so developers can initialize it with a scene, camera, controls, player model, animations, starting position, and colliders. Add methods to update each frame, reset, destroy, change view, adjust speed and camera settings, register animations, and read useful state like position, velocity, current view, ground state, active vehicle, and current animation.
Want more depth? Deep Reverse