// Copyright Anima Ludis Studio
include “Charachter/RipperCharacter.h”
include “camera/CameraPawnBase.h”
include “GameFramework/CharacterMovementComponent.h”
include “Player/DocPlayerController.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;
}
void ARipperCharacter::BeginPlay()
{
Super::BeginPlay();
ADocPlayerController* PlayerController = Cast<ADocPlayerController>(GetController());
if (PlayerController)
{
CameraPawn = GetWorld()->SpawnActor<ACameraPawnBase>();
if (CameraPawn)
{
CameraPawn->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
}
}
}