Okay, I slept on this after tinkering with the ACameraActor class as well. I understand that SetViewTarget() only takes Actors as arguments, whereas SetRelativeLocation() and SetRelativeRotation() take CameraComponent arguments.
So this is what I tried next. The result is that whenever I try to compile the code, Unreal Engine crashes, and I can’t reopen the project successfully without commenting out the SetViewTarget() line.
//Create a third person camera component
ThirdPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("ThirdPersonCamera"));
check(ThirdPersonCameraComponent != nullptr);
//Position the camera about 5 meters away from the bird, sideways
ThirdPersonCameraComponent->SetRelativeLocation(FVector(CAMERA_OFFSET_X, CAMERA_OFFSET_Y, CAMERA_OFFSET_Z));
//Rotate the camera to face the player, and so that player appears to face to the right.
ThirdPersonCameraComponent->SetRelativeRotation(FRotator(0.0f, 0.0f, CAMERA_ROTATE));
//Set the view to the player's third person camera
[EDIT] I should specify that “this” is a subclass of a Pawn, because I want this class to be the player controlled object. Based on the documentation, I was to believe that the Pawn class is a child class of the Actor class. Am I mistaken?