The character with camerio is implemented in a separate class.
I put the control in a separate class.
Is it possible to implement camera rotation and zoom control inside the input controller code?
Thanks in advance for your help. I would appreciate any attempt. Do not get angry with me.
include “Charachter/RipperCharacter.h”
include “GameFramework/SpringArmComponent.h”
include “Camera/CameraComponent.h”
include “GameFramework/CharacterMovementComponent.h”
ARipperCharacter::ARipperCharacter()
{
GetCharacterMovement()->bOrientRotationToMovement = true;
GetCharacterMovement()->RotationRate = FRotator(0.f, 400.f, 0.f);
GetCharacterMovement()->bConstrainToPlane = true;
GetCharacterMovement()->bSnapToPlaneAtStart = true;
bUseControllerRotationPitch = false;
bUseControllerRotationRoll = false;
bUseControllerRotationYaw = false;
CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
CameraBoom->SetupAttachment(RootComponent);
CameraBoom->bUsePawnControlRotation = true;
CameraCharacter = CreateDefaultSubobject<UCameraComponent>(TEXT("CameraCharacter"));
CameraCharacter->SetupAttachment(CameraBoom);
CameraCharacter->FieldOfView = 90.0f;
CameraCharacter->bUsePawnControlRotation = false;
CameraCharacter->bAutoActivate = true;
}
void ARipperCharacter::BeginPlay()
{
Super::BeginPlay();
}
// Copyright Anima Ludis Studio
#pragma once
include “CoreMinimal.h”
include “Charachter/DocCharacterBase.h”
include “RipperCharacter.generated.h”
/**
*
*/
UCLASS()
class MYSTERYDARKEPIDEMIC_API ARipperCharacter : public ADocCharacterBase
{
GENERATED_BODY()
public:
ARipperCharacter();
protected:
virtual void BeginPlay() override;
protected:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Components")
class USpringArmComponent* CameraBoom;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Components")
class UCameraComponent* CameraCharacter;
};