I generated a default ThirdPerson game and then I wanted to support other camera and movement modes. When I changed to first person the camera did not move as instructed. I ultimately figured out that the problem was I had renamed “FollowCamera” to “CharacterCamera” and that broke everything. I would like to know why because that doesnt make sense. All that changes was the string inside the TEXT() call:
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera"));
Was changed to:
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("CharacterCamera"));
And this broke:
// in SetupThirdPersonCamera()
Camera->AttachToComponent(CameraBoom, FAttachmentTransformRules::KeepRelativeTransform, USpringArmComponent::SocketName);
// in SetupFirstPersonCamera()
Camera->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetNotIncludingScale, FName("head"));
Changing it back fixed it but I would REALLY love to know why.