I created a class deriving from ACharacter
But there’s no camera: there’s an ArrowComponent, a MovementComponent and a Mesh.
I needed a Camera so I added it through code
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
Camera->SetupAttachment(RootComponent);
torchLightComponent = CreateDefaultSubobject<USpotLightComponent>(TEXT("SpotLight_Torch"));
torchLightComponent->SetupAttachment(Camera);
Now I have the Camera with a Spotlight attached to it
The problem is: I can’t look up and down anymore!
The InputComponent is set like this:
InputComponent->BindAxis("Turn", this, &ATCharacter::AddControllerYawInput);
InputComponent->BindAxis("LookUp", this, &ATCharacter::AddControllerPitchInput);
I can’t understand the problem…
Thanks in advance.