Im making a 2D top down game and I’m trying to set up the camera to look straight down upon the player. If I place a player actor and look at what it’s camera is doing it works correctly.
( I know my sprite will appear invisible because it is directly above it)
However, using the default start actor it gives me a view like this which I assume is the game creating its own default camera.
But the movement of the player all works correctly still. I am using the correct gamemode the one that I created and the default pawn class is also the correct one. I think my error comes from this code but I’m not too sure.
}
//Initialise the Spring Arm
//RootComponent = GetMesh();
SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
SpringArm->SetupAttachment(GetMesh());
SpringArm->SetRelativeRotation(FRotator(0.0f, -90.0f, 90.0f));
SpringArm->SocketOffset = FVector(0.0f, 75.0f, 0.0f);
SpringArm->TargetArmLength = 900.f;
SpringArm->SetUsingAbsoluteRotation(true);
SpringArm->bDoCollisionTest = false;
//Initialise the Camera
CamComp = CreateDefaultSubobject<UCameraComponent>(TEXT("CamComp"));
CamComp->ProjectionMode = ECameraProjectionMode::Perspective;
CamComp->SetupAttachment(SpringArm, USpringArmComponent::SocketName);
CamComp->bAutoActivate = true;
CamComp->bUsePawnControlRotation = true;
//CamComp->SetWorldRotation(FRotator(0.0f, 0.0f, 0.0f));
Any help would be greatly appreciated, thank you.