I need to change the main camera in a minimum project c++, i have a default camera but i can´t delete this camera and i don´t know create a new camera and set this te principal, the idea is create a new camera no movable and i move the camera by c++ code, how i can create the new camera and set `principal?.
AFAIK the Unreal default camera will never go away. It is there as a backup in case your code screws up.
As for your own camera, just create a camera in whatever your main default character class is.
// declare camera in .h file
// top of .cpp file
// create camera in constructor in .cpp file
_cameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));
_cameraComponent->SetRelativeLocation(FVector(-40.0f, 0.0f, 64.f));
_cameraComponent->bUsePawnControlRotation = true;