Make camera smoothly follow rigid body?

Hey all! So I have a ship that I finally got to fly around pretty smoothly, now I need to be pointed in the right direction for camera controls. Could someone tell me where to look or give an example of how to create my own camera and set it up via C++ to follow my ship smoothly, and do a mouse orbit around it’s target? Even just to give the camera a look at and follow target, I can figure out the smooth part. Any help is greatly appreciated, thanks in advanced!

Maybe I bit late, but for anyone, who will find this question…
There is no definitive guide on setting up the camera in C++, I figured it out myself at some point.
So, basically, you need to create a camera component and a “camera boom” component in your character (or actor).
In the header file:

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera)
TSubobjectPtr<USpringArmComponent> CameraBoom;

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera)
TSubobjectPtr<UCameraComponent> FollowCamera;

And in constructor:

// Constructing components
FollowCamera = PCIP.CreateDefaultSubobject<UCameraComponent>(this, TEXT("MainCamera"));
CameraBoom = PCIP.CreateDefaultSubobject<USpringArmComponent>(this, TEXT("CameraBoom"));

// Setting up the attachements
CameraBoom->bUseControllerViewRotation = true; // This is how you will control the camera rotation

This setup is handy for any third-person game. You may control distance from camera to object by adjusting TargetArmLength on the CameraBoom component.

Thx man :slight_smile: