FPSTutorial Camera Issue


I’m doing the FPS Tutorial

I was about to implement the AFPSCharacter Constructer to initialize a new Camera Component.

  AFPSCharacter::AFPSCharacter(const FObjectInitializer& ObjectInitializer)
       : Super(ObjectInitializer)
       // Create a CameraComponent 
       FirstPersonCameraComponent = ObjectInitializer.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FirstPersonCamera"));
       FirstPersonCameraComponent->AttachToComponent(GetCapsuleComponent, FAttachmentTransformRules::KeepWorldTransform);

FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 50.0f + BaseEyeHeight);

FirstPersonCameraComponent->bUsePawnControlRotation = true;

When I compile and play I can’t move the camera up and down, only left and right.
I also tried it with FAttachmentTransformRules::KeepRelativTransform and even the depracted AttachTo doesnt work.

No one who have a idea?

so this may solve you problem: