mrdoob/three.js — Issue #1056: How to use FlyControls?
Author: LiquidSnakeX
Created: 2012-01-10 02:37:22+00:00
State: open

I've created a basic template loosely based on [Aerotwist's Starter Example](http://aerotwist.com/lab/getting-started-with-three-js/) and all I want to do for now is to control the camera with the mouse and keyboard, but I can't figure out how to get it working, I've looked for references on how to use FlyControls but couldn't find anything other than the snippet in [this issue](https://github.com/mrdoob/three.js/issues/1016) :/

I'm running this in Chrome 16.0.912.75 so the requestAnimationFrame is webkit-specific. The Javascript console gives the error: **Uncaught TypeError: Cannot call method 'focus' of null** occurring in the three.js source.

Any help or additional FlyCamera documentation would be appreciated!

I'm using Three.js r46, all code is self contained in the source below and should run as is:

Test