Player Look Settings and Look Input
Two things decide how the camera answers the player's hands. The player look settings are the player's own preferences (sensitivity, invert Y, field-of-view offset and framing assist), stored with their input bindings so an options menu can change them. The look input on each view names the input actions that turn it.
Player look settings
plCameraPlayerSettings reads the settings from the running game application's input bindings every frame, so a change in an options menu applies at once. The values are stored as named values in InputBindings.ddl, in the same settings folder as GameSettings.ddl, next to the player's rebinding overrides. When there is no game application, the defaults below are used.
| Key | Default | Description |
|---|---|---|
Camera.LookSensitivity | 1 | Multiplier on all look input of first- and third-person views. Values below 0 count as 0. |
Camera.InvertY | 0 | Values above 0.5 invert vertical look input. |
Camera.FieldOfViewOffset | 0 | Degrees added to every field of view written to the camera, by the director and by standalone views. The result is kept between 1° and 170°. |
Camera.MouseAssist | 0 | How strongly Composition may turn a first- or third-person camera while the player uses keyboard and mouse (0–1). |
Camera.GamepadAssist | 1 | The same while the player uses any other input scheme (0–1). |
The assist value in effect follows the input scheme the player is using right now, so switching from mouse to gamepad mid-game switches the assist too. Assist only scales Composition's soft-zone correction, and the soft-zone edge always holds. See Framing.
Changing the settings from game code
| Call | Sets |
|---|---|
plCameraPlayerSettings::SetLookSensitivity(float) | Camera.LookSensitivity |
plCameraPlayerSettings::SetInvertY(bool) | Camera.InvertY |
plCameraPlayerSettings::SetFieldOfViewOffset(float) | Camera.FieldOfViewOffset |
plInputBindings::SetValue(key, value) | Any key, including the two assist keys. |
plInputBindings::Execute("SetValue", { Key, Value }) | Any key, from game UI or managed code. Execute("Query") returns the stored values under Values. |
The input bindings save pending changes to InputBindings.ddl during their per-frame update.
Adding camera options to an options menu
- Add a slider for look sensitivity (for example 0.2 to 3) and a toggle for invert Y.
- When the slider changes, call
Execute("SetValue", args)on the game application's input bindings, whereargsholdsKey="Camera.LookSensitivity"andValue= the slider value. For the toggle, setCamera.InvertYto 0 or 1. - Optionally add a field-of-view slider that sets
Camera.FieldOfViewOffset, for example from -10 to 20. - For an "aim assist" or "camera assist" option, set
Camera.GamepadAssist(andCamera.MouseAssistif mouse players should get it) between 0 and 1. - When the menu opens, read the current values with
Execute("Query")to fill the controls.
Look input
The Third Person and First Person views have a LookInput property of type plCameraLookInput, in their Control group. It names the input actions that turn the view, read through a plInputComponent. The view looks for that component on its subject and the subject's parents first, then on the view's own object and its parents. It must be active.
| Property | Default | Description |
|---|---|---|
LookAction | empty | A vector action: x turns right, y looks up. |
TurnLeftAction | empty | Turns left by the action's value. |
TurnRightAction | empty | Turns right by the action's value. |
LookUpAction | empty | Looks up by the action's value. |
LookDownAction | empty | Looks down by the action's value. |
Sensitivity | 1 | Multiplier for this view (0–100). |
InvertY | off | Inverts vertical input for this view. |
The vector action and the four directional actions are all read and added together, so a project can bind a stick to the vector action and keep existing look buttons. With no action set, the view reads no input and is driven by script only.
How values are interpreted
Action values are treated as per-frame deltas in radians. The amount applied each frame is:
(vector + directional actions) × Sensitivity × Camera.LookSensitivity × zoom look scale
The zoom look scale comes from active Zoom modifiers and is 1 otherwise. The view's InvertY and the player's Camera.InvertY each flip the vertical part, so with both on the input is not inverted.
Mouse movement already arrives as an amount per frame and fits this directly. An action that reports a steady value while held, such as a stick or a key, is applied in full every frame: at value 1 and Sensitivity 1 it turns one radian per frame, and it turns faster at higher frame rates. Give such actions a small scale in the input action map or a low Sensitivity.
Steering
Any non-zero look input in a frame marks the player as steering that frame. Composition then holds back its soft-zone correction, Look At breaks out (with BreakOnInput), Look Hint restarts its idle timer, and the Third Person View restarts its recenter delay. Panning a Top-Down View also counts as steering.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Settings changes have no effect | The values were written somewhere other than the game application's input bindings, or the key name is misspelled. Keys are case sensitive. |
| The camera spins far too fast with a stick | Stick values are applied per frame. Scale the action down or lower Sensitivity. |
| Vertical look is inverted unexpectedly | Both the view's InvertY and Camera.InvertY flip it, so check both. |
| Field of view in the editor's play mode differs from a build | A stored Camera.FieldOfViewOffset applies wherever the input bindings are loaded. |
See also: Gameplay Cameras · Camera Views · Framing, Look At and Focus · The Modifier Stack