How-To: Add Camera Lag & Recenter
Goal: make the camera body trail smoothly (lag) and return behind the character (recenter) - both off by default on the third-person mode.
UCrimsonCameraMode_ThirdPerson subclass.1. Enable lag and auto-recenter (mode properties)
Lag and auto-recenter are toggled by properties on the mode - set them once in the mode's Details (Blueprint) or constructor (C++). Lag smooths the view, never the control rotation, so aiming stays crisp.
Auto-recenter is idle-gated: it engages only after the player has stopped moving the look axis and the character's horizontal speed has stayed at or below RecenterIdleSpeedThreshold for RecenterDelay seconds. Either one resuming restarts the full delay, so the camera never fights a player who is still looking around or running. Once it engages it eases yaw behind the character and pitch back to RecenterNeutralPitch.
RecenterDelay the view eases back behind the character. It should not move while you are still running or still looking around.2. Recenter on demand
Call Recenter Camera (e.g. on a button) to swing behind the character once, returning pitch to RecenterNeutralPitch as well as yaw. It works whether or not auto-recenter is enabled, and unlike auto-recenter it is not idle-gated - press it mid-sprint and it recenters immediately. Player look input cancels it. Recenter is a per-mode method (unlike shoulder/zoom, which are on the component), so fetch the live mode instance with Get Camera Mode Instance and cast it to your third-person mode first.
Set Camera Lag Enabled/Speed, Set Auto Recenter Enabled/Delay/Interp Speed) on the active mode instead of setting them once. See How-To: Expose Camera Options as User Settings.See also
- How-To: Expose Camera Options as User Settings - drive lag / recenter live from a player menu.
- Concept: The Mode Stack & Blending - lag and recenter are per-mode-instance state.