RealDocs

UCameraComponent

class Engine Blueprint Since 4.0
#include "Camera/CameraComponent.h"

Description

A component that defines a camera view. Attach it to an actor to make that actor capable of providing a camera perspective to the player.

Caveats & Gotchas

  • The camera only becomes active when the owning actor is possessed and the player's view target is set. Attaching a UCameraComponent does not automatically make it the active camera.
  • FOV, aspect ratio, and projection mode are set on the component. Post-process settings can also be applied here.
  • Typically paired with a USpringArmComponent to get a smooth third-person follow camera.

Example

Add a camera to a character C++
UCameraComponent* 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.