Stop Camera From Following Character Top Down Template C++

Hi could someone help me I’ve been stuck for hours doing this kind of problem

What I need to achieve:
1.) Camera Stops Following the Character
2.) When I Click 1 or F1 the Camera will go to the characters top view originally but still wont follow ( LIKE DOTA2)

What I am trying to do is I set my mobility to static and have a method




void AC_ProjectCharacter::FocusCameraCharacter()
{
    GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Focus Camera To Object"));
    FVector NewLocation = GetActorLocation();
    NewLocation.X = 100.f;
    CameraBoom->SetWorldLocation(NewLocation);
}



But the problem with this is that I cannot move the cameraboom because it is in static not movable . Is there any way to achieve what I want

add a scene component to the character, attach camera to it, and detach this component from character when you want to move it independently from character (or not to move), and attach again when you need it…