How to change the default PC camera?

Hello, I’m creating a top down 2D Trading card game, I’ve subclased the PC class and copied the code from the topdown c++ template. The problem is that my PC now has two cameras and it’s using the one that it has by default. How can i set my CameraComponent to be the default camera for the PC?

Also is this the best way? I just want a static topdown camera in all the lvls, it won’t move or anything, just render and receive input that doesn’t affect it’s transform.

Here’s my current code:

CardPlayerController.h

UCLASS()
class CARDGAME_API ACardPlayerController : public APlayerController
{
	GENERATED_UCLASS_BODY()

	/** Top down camera */
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera)
	TSubobjectPtr<class UCameraComponent> TopDownCameraComponent;

	/** Camera boom positioning the camera above the character */
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera)
		TSubobjectPtr<class USpringArmComponent> CameraBoom;


	virtual void BeginPlay() override;
};

CardPlayerController.cpp

ACardPlayerController::ACardPlayerController(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
	// Create a camera boom...
	CameraBoom = PCIP.CreateDefaultSubobject<USpringArmComponent>(this, TEXT("CameraBoom"));
	CameraBoom->AttachTo(RootComponent);
	CameraBoom->bAbsoluteRotation = true; // Don't want arm to rotate when character does
	CameraBoom->TargetArmLength = 0.f;
	CameraBoom->RelativeRotation = FRotator(-90.f, 0.f, 0.f);
	CameraBoom->bDoCollisionTest = false; // Don't want to pull camera in when it collides with 
	// Create a camera...
	TopDownCameraComponent = PCIP.CreateDefaultSubobject<UCameraComponent>(this, TEXT("TopDownCamera"));
	TopDownCameraComponent->AttachTo(CameraBoom, USpringArmComponent::SocketName);
	TopDownCameraComponent->bUseControllerViewRotation = false; // Camera does not rotate relative to arm

	bShowMouseCursor = true;
}


void ACardPlayerController::BeginPlay()
{
	
}

When you start you will posses Default Pawn, so it will take the Default Pawn Camera, or eye position of Pawn. If you Unposses it will use SpectatorPawn, so camera you attach into Controller never be used.

You can create a Pawn or Actor with camera component and fix position in level, and in Level Blueprint. get player controller and call SetViewTarget, point to actor with camera. Any input you can get from Controller, as long as you don’t pass any input to that actor, it will never move.

Thank you for your answer.One question tho, so if i wanted to detect if a card was clicked,you say that i should put the logic inside the player controller?

Yes, you can detect Left Mouse click then use trace to know which card you click on Controller, or you can enable MouseOverLapEvent in Player Controller, then add OnMouseOverlap event on your card actor, it will show you when you overlap you card, then just detect mouse click.

But i prefer you use the line trace and put it in controller.