Builtin Library
README.md
camera_settings
The person's camera and controls on this client.
It declares the Camera and controls group of the client settings
(clientSettings), a section of the app menu's System tab that a player
reaches from the pause menu. Each setting is kept for the person's account on
this device, the same in every world and after a restart:
- Look speed for the mouse, the controller stick and touch
(
camera.sensitivity.mouse,.stick,.touch): a share of the game's own look speed, 10% to 400%, 100% by default; - Invert vertical look for each of the three
(
camera.invertY.mouse,.stick,.touch); - Field of view (
camera.fieldOfView): degrees, -20 to +30, every game camera's view widens or narrows by, from what the game chose; a camera that renders into a texture, an orthographic camera and the editor's own camera keep their own; - Reduced camera motion (
camera.reducedMotion): the follow cameras stop running ahead of their subject, a mounted camera stops leaning with its vehicle,FPSControllershakes the view no more, andshake()answers 0; - Stick dead zone (
camera.stickDeadzone): the share of a controller stick's travel that reads as rest, 0.15 by default, for every stick binding that states no dead zone of its own; - Camera turns back behind you (
camera.recenter): off, the follow cameras, the chase camera and the mounted camera hold a look until the player turns them back or the game asks (recenter()).
Reading them
camera_settings.current() states the values in force. A camera applies
them with:
look(dx, dy, class): a look control's reading scaled by its device's look speed and inverted where the person inverted it;fieldOfView(authored): the field of view a camera authored at that many degrees shows;recenterDelay(delay): the rig's own delay, or -1 while the person turned recentring off;motion()andshake(): 1, or 0 under reduced camera motion.
Every built-in rig (orbital_follow, third_person_follow, chase, mount,
first_person, orbit, rts, legacy.third_person), FPSController and
the Camera component read them every frame, so a change in the menu reaches
a running camera on its next frame.