Answer the question
In order to leave comments, you need to log in
Why is UCameraComponent not working?
There is a ChessPawn class. It creates a Camera and a SpringArmComponent. But when the Play button is pressed, a CameraActor is created, from which the scene is viewed.
this->camera = this->CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
this->springArm = this->CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
this->springArm->TargetArmLength = 8000;
this->SetRootComponent(this->springArm);
this->camera->SetupAttachment(this->springArm);
Answer the question
In order to leave comments, you need to log in
It turned out that I attached the camera incorrectly. It was necessary like this:
this->camera->SetupAttachment(this->springArm, USpringArmComponent::SocketName);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question