How-To: Expose Camera Options as User Settings
Goal: let players tune the camera from an options menu - field of view, screen-shake intensity, occlusion fade, camera lag, and auto-recenter. CrimsonCamera exposes a runtime setter for each; any system can call them. Storing and applying the player's choices is yours to wire.
UCrimsonCameraComponent and a working third-person mode (Quick Start). For occlusion options, the pawn also has a UCrimsonCameraOcclusionComponent.UGameUserSettings, a save game, your own options screen), call the matching setter below when the player changes a value, and once more after the pawn is possessed: FOV, shake scale, and occlusion live on components owned by the pawn, so a new pawn starts from the authored defaults again.(CrimsonCore - requires all Crimson plugins) CrimsonCore does this wiring for you - its
ACrimsonCorePlayerCameraManager reads the player's saved camera values and applies them each frame by calling exactly these setters.1. Field of view (absolute override)
Set Field Of View Override sets an absolute FOV applied after the per-mode blend, so every mode renders at that FOV. Pass 0 (or less) to clear it and fall back to each mode's authored FOV.
In your options widget, on the FOV slider's On Value Changed event: -> Get Player Pawn -> Find Camera Component -> Set Field Of View Override (New Field Of View = the event's Value, in degrees). Wire a Reset to default button to the same node with New Field Of View = 0 so each mode goes back to its authored FOV.
showdebug camera), and it holds when you switch to aim / lock-on.0) to restore per-mode FOVs.2. Screen-shake intensity
Set Camera Shake Scale is a global screen-shake intensity for that player (default 1.0; 0 disables shakes entirely). It is not limited to shakes this plugin played - it scales every shake the player's camera receives, including Play World Camera Shake, camera shake source components, and Sequencer shake tracks.
On the shake-intensity slider's On Value Changed: -> Get Player Pawn -> Find Camera Component -> Set Camera Shake Scale (New Scale = the event's Value, 0 to 1). Map the slider range to 0..1 - 1 is authored strength and 0 silences every shake this player receives.
ACrimsonPlayerCameraManager installs UCrimsonCameraModifier_CameraShake in place of the engine's shake modifier. Every engine shake path - Start Camera Shake, Play World Camera Shake, camera shake source components, Sequencer - routes through the camera manager's cached shake modifier, so scaling there catches all of them. This requires the camera manager to be ACrimsonPlayerCameraManager (see Quick Start); with a different camera manager the scale falls back to applying only to Play Camera Shake.0 and shakes stop - including one fired from a Play World Camera Shake node that never touches this plugin. Set 0.5 and the same hit shakes at half strength. Because the scale is applied per frame, changing the slider during a long shake takes effect immediately. A shake played while the scale is 0 still runs and expires on schedule, so raising the scale afterwards does not release a backlog of silent shakes.3. Occlusion fade (on/off + strength)
On the pawn's UCrimsonCameraOcclusionComponent, Set Occlusion Enabled(false) turns fading off and snaps any faded geometry back to its original material; Set Occlusion Fade Strength(0..1) sets how far occluders fade.
Get Player Pawn -> Get Component by Class (Component Class = Crimson Camera Occlusion Component). From that pin, wire the on/off checkbox's On Check State Changed to Set Occlusion Enabled (Enabled), and the strength slider's On Value Changed to Set Occlusion Fade Strength (New Amount, 0 to 1). Both are safe to call before any occluder is faded.
4. Camera lag & auto-recenter (runtime)
How-To: Lag & Recenter sets these once on the mode. To change them live from an options menu, fetch the active third-person mode and call its setters.
Get Player Pawn -> Find Camera Component -> Get Active Camera Mode -> Cast To <your third-person mode>, then off the cast result call the setter each control drives: Set Camera Lag Enabled (Enabled), Set Camera Lag Speed (New Speed), Set Auto Recenter Enabled (Enabled), Set Auto Recenter Delay (New Delay), Set Auto Recenter Interp Speed (New Speed). Get Camera Mode Instance (Camera Mode Class = your mode) works just as well when you want to write the values whether or not that mode is the one on screen right now.
ACrimsonCorePlayerCameraManager).See also
- How-To: Lag & Recenter - the mode properties these setters drive.
- How-To: Occlusion Fade - the occlusion component setup.