game mode
This commit is contained in:
parent
bcf4af827c
commit
fef6bd8e3e
Binary file not shown.
Binary file not shown.
BIN
Content/Blueprints/Game/BP_AuraGameModeBase.uasset
Normal file
BIN
Content/Blueprints/Game/BP_AuraGameModeBase.uasset
Normal file
Binary file not shown.
Binary file not shown.
@ -3,3 +3,35 @@
|
||||
|
||||
#include "Character/AuraCharacter.h"
|
||||
|
||||
#include "Camera/CameraComponent.h"
|
||||
#include "GameFramework/CharacterMovementComponent.h"
|
||||
#include "GameFramework/SpringArmComponent.h"
|
||||
|
||||
AAuraCharacter::AAuraCharacter()
|
||||
{
|
||||
SpringArm = CreateDefaultSubobject<USpringArmComponent>("SpringArm");
|
||||
SpringArm->TargetArmLength = 700.f;
|
||||
SpringArm->bEnableCameraLag = true;
|
||||
SpringArm->CameraLagSpeed = 10;
|
||||
SpringArm->bUsePawnControlRotation = false;
|
||||
|
||||
SpringArm->bInheritPitch = false;
|
||||
SpringArm->bInheritRoll = false;
|
||||
SpringArm->bInheritYaw = false;
|
||||
|
||||
SpringArm->SetRelativeRotation (FRotator (0.f, -45.f, 0.f));
|
||||
SpringArm->SetupAttachment(GetRootComponent ());
|
||||
|
||||
Camera = CreateDefaultSubobject<UCameraComponent>("Camera");
|
||||
Camera->bUsePawnControlRotation = false;
|
||||
Camera->SetupAttachment(SpringArm);
|
||||
|
||||
GetCharacterMovement()->bOrientRotationToMovement = true;
|
||||
GetCharacterMovement()->RotationRate = FRotator (0.f, 400.f, 0.f);
|
||||
GetCharacterMovement()->bConstrainToPlane = true;
|
||||
GetCharacterMovement()->bSnapToPlaneAtStart = true;
|
||||
|
||||
bUseControllerRotationPitch = false;
|
||||
bUseControllerRotationYaw = false;
|
||||
bUseControllerRotationRoll = false;
|
||||
}
|
||||
|
5
Source/Aura/Private/Game/AuraGameModeBase.cpp
Normal file
5
Source/Aura/Private/Game/AuraGameModeBase.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
// Copyright; GhostPacket Games
|
||||
|
||||
|
||||
#include "Game/AuraGameModeBase.h"
|
||||
|
@ -6,12 +6,21 @@
|
||||
#include "Character/AuraCharacterBase.h"
|
||||
#include "AuraCharacter.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class USpringArmComponent;
|
||||
class UCameraComponent;
|
||||
|
||||
UCLASS()
|
||||
class AURA_API AAuraCharacter : public AAuraCharacterBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AAuraCharacter ();
|
||||
|
||||
private:
|
||||
UPROPERTY (EditAnywhere)
|
||||
TObjectPtr<USpringArmComponent> SpringArm;
|
||||
|
||||
UPROPERTY (EditAnywhere)
|
||||
TObjectPtr<UCameraComponent> Camera;
|
||||
};
|
||||
|
17
Source/Aura/Public/Game/AuraGameModeBase.h
Normal file
17
Source/Aura/Public/Game/AuraGameModeBase.h
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright; GhostPacket Games
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "AuraGameModeBase.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class AURA_API AAuraGameModeBase : public AGameModeBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user