RealDocs

USpringArmComponent

class Engine Blueprint Since 4.0
#include "GameFramework/SpringArmComponent.h"

Description

A component that maintains a fixed distance from its parent, retracting when obstructed by geometry and smoothly returning to its target length. Used as the arm for third-person cameras.

Caveats & Gotchas

  • TargetArmLength is in Unreal units (cm). 300.0 is a common starting value for third-person games.
  • bUsePawnControlRotation on the spring arm inherits the controller's rotation (pitch/yaw from mouse input). Set bUsePawnControlRotation=false on the attached camera to avoid double-rotation.
  • Camera lag (bEnableCameraLag) adds latency to the arm position — useful for smoothness but can feel sluggish in action games. Tune CameraLagSpeed accordingly.

Example

Standard third-person camera setup C++
SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
SpringArm->SetupAttachment(RootComponent);
SpringArm->TargetArmLength = 300.f;
SpringArm->bUsePawnControlRotation = true;

Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
Camera->SetupAttachment(SpringArm, USpringArmComponent::SocketName);
Camera->bUsePawnControlRotation = false;

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.