Character camera spawns in wrong place

My FPS camera will only position at this one location on the map despite my C++ code and my derived blueprint class setting it to be positioned elsewhere relative to the character. In the picture here I dragged 3 characters onto the map. As you can see the cameras are positioned in the same exact place in the middle of the map even though the characters were placed in different locations. This happens as well when the map gamemode spawns the default pawn (FPSCharacter) at PlayerStarts. I notice that in the blueprint editor the camera position looks correct but the in the details panel it onlys shows the scale in the transform category, not the position or rotation.

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera")
class UCameraComponent* Camera;

// Create and setup first person camera.
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
Camera->RelativeLocation = FVector(0.0f, 0.0f, BaseEyeHeight);
Camera->bUsePawnControlRotation = true;

The character movement does not work either, seemly because of this bug. While trying to debug the problem I removed the camera altogether. The crazy thing is that after doing this the camera and movement behaviour works correctly despite the editor says no camera is present.

In the glitched state I can move the character manually and camera does follow. I’ve gone into previous versions of the project where this is not happening. I make changes to the old project to try and update the content to the newer version, but as some point it crashes and the issue returns.

I’m not sure what to do. I really appreciate any help. Thank you.

So it seems like you are missing this line of code before setting Relative Location:

FPSCameraComponent->SetupAttachment(GetCapsuleComponent());

I believe you could attach it to RootComponent or mesh instead if you prefer.

Was this ever solved? I’m having the exact same issue even with the above line of code inserted. Please help!

I had an order of operations bug that was similar using blueprints. In my case removing the camera from an attached Spring Arm then reattaching and saving fixed my issue. There appears to be a problem in propagating changes from the actor class to an instance of it and moving things around in the BP class object Details resolved it in my case.