The camera spring arm resolves a desired camera position against supplied trace hits. Gameplay code performs the world trace from the pivot toward the desired camera location, then passes the trace data into this deterministic evaluator.
Runtime Surface#
FV2CameraSpringArmConfigdefines arm length limits, probe radius, collision buffer, pull-in speed, recovery speed, collision enablement, recovery smoothing, aim behavior, and blend time.FV2CameraSpringArmStatecarries the pivot, desired camera location, current arm length from the previous frame, and FOV.FV2CameraSpringArmTraceHitmirrors the trace data the spring arm needs: blocking flag, impact point, hit distance, surface normal, and penetration.FV2CameraSpringArmEvaluationreturns desired, target, and adjusted arm lengths, the adjusted camera pose, collision and recovery flags, camera manager mode spec, and validation issues.
Collision Rules#
- Desired arm length is the distance from pivot to desired camera, clamped to
MinArmLengthandMaxArmLength. - The nearest blocking trace hit wins.
- The collision target length is
HitDistance - CollisionBuffer, clamped betweenMinArmLengthand the desired arm length. - Penetrating hits resolve to
MinArmLength. - Collision pull-in uses
PullInSpeed * DeltaSecondsso the camera moves forward quickly but deterministically. - With no collision, shorter current arms recover toward the desired arm using
RecoverySpeed * DeltaSecondswhenbSmoothRecoveryis enabled. - Blocking issues are emitted for invalid config, invalid state, invalid trace data, or negative delta time.
Camera Manager Export#
EvaluateCameraSpringArm fills ModeSpec with a third-person camera mode using
id camera.third_person.spring_arm. BuildCameraSpringArmMode can export a
custom id, priority, and active flag for the camera manager stack.
Validation Commands#
Run these targeted checks when touching the spring arm:
bash
python3 V2/ue/Tools/check-v2-camera-spring-arm.py
python3 V2/ue/Tools/check-v2-third-person-orbit-camera.py
python3 V2/ue/Tools/check-v2-camera-manager.py
python3 V2/ue/Tools/check-v2-ci-workflow.py
python3 -m json.tool V2/ue/Content/V2/Gameplay/Camera/CameraSpringArm_V2_Contract.json
python3 -m py_compile V2/ue/Tools/check-v2-camera-spring-arm.py