The problems are not finished yet actually…
Now this code literally does nothing :
// Position the camera slightly above the eyes.
FPSCameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, 50.0f + BaseEyeHeight));
With or without it it’s the same, and changing the 50.0f value or removing + BaseEyeHeight does not change the camera position at all…
Maybe it’s because I’ve set
// Attach the camera component to our capsule component. FPSCameraComponent->SetupAttachment(RootComponent);
instead of
// Attach the camera component to our capsule component.
FPSCameraComponent->SetupAttachment(GetCapsuleComponent());
So I’ve used the lower version of this code, the trick to solve it was to #include "Components/CapsuleComponent.h"
That’s weird. According to https://docs.unrealengine.com/en-US/API/Runtime/Engine/GameFramework/ACharacter/GetCapsuleComponent/index.html, it should’ve worked only with #include "GameFramework/Character.h"
…