File: FirstPersonControls.md | Updated: 11/15/2025
This class is an alternative implementation of FlyControls.
FirstPersonControls is an addon, and must be imported explicitly, see Installation#Addons.
import { FirstPersonControls } from 'three/addons/controls/FirstPersonControls.js';
Constructs a new controls instance.
object | The object that is managed by the controls.
---|---
domElement | The HTML element used for event listeners. Default is null.
Whether it's possible to look around or not.
Default is true.
Whether the camera is automatically moved forward or not.
Default is false.
Whether or not looking around is vertically constrained by verticalMin and verticalMax.
Default is false.
Determines how much faster the camera moves when it's y-component is near heightMax.
Default is 1.
Upper camera height limit used for movement speed adjustment.
Default is 1.
Lower camera height limit used for movement speed adjustment.
Default is 0.
Whether or not the camera's height influences the forward movement speed. Use the properties heightCoef, heightMin and heightMax for configuration.
Default is false.
The look around speed.
Default is 0.005.
Whether it's possible to vertically look around or not.
Default is true.
Whether the mouse is pressed down or not.
Default is false.
The movement speed.
Default is 1.
How far you can vertically look around, upper limit. Range is 0 to Math.PI in radians.
Default is 0.
How far you can vertically look around, lower limit. Range is 0 to Math.PI in radians.
Default is 0.
Must be called if the application window is resized.
Rotates the camera towards the defined target position.
x | The x coordinate of the target position or alternatively a vector representing the target position.
---|---
y | The y coordinate of the target position.
z | The z coordinate of the target position.
Returns: A reference to this controls.