Detatch Camera from Player
This commit is contained in:
parent
4c584372cc
commit
3477676851
BIN
Content/Levels/Level.umap
(Stored with Git LFS)
BIN
Content/Levels/Level.umap
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Player/BP_PlayerCharacter.uasset
(Stored with Git LFS)
BIN
Content/Player/BP_PlayerCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -10,29 +10,10 @@
|
|||||||
#include "GoldComponent.h"
|
#include "GoldComponent.h"
|
||||||
#include "InputMappingContext.h"
|
#include "InputMappingContext.h"
|
||||||
#include "WeaponInventoryComponent.h"
|
#include "WeaponInventoryComponent.h"
|
||||||
#include "Camera/CameraComponent.h"
|
|
||||||
#include "Components/WidgetComponent.h"
|
#include "Components/WidgetComponent.h"
|
||||||
#include "GameFramework/SpringArmComponent.h"
|
|
||||||
|
|
||||||
APlayerCharacter::APlayerCharacter()
|
APlayerCharacter::APlayerCharacter()
|
||||||
{
|
{
|
||||||
// Create Camera Boom
|
|
||||||
CameraSpringArmComponent = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraSpringArmComponent"));
|
|
||||||
CameraSpringArmComponent->SetupAttachment(RootComponent);
|
|
||||||
CameraSpringArmComponent->bDoCollisionTest = true;
|
|
||||||
CameraSpringArmComponent->bUsePawnControlRotation = false;
|
|
||||||
CameraSpringArmComponent->TargetArmLength = 1000;
|
|
||||||
CameraSpringArmComponent->bEnableCameraLag = false;
|
|
||||||
CameraSpringArmComponent->SocketOffset = {0.0f, 0.0f, 0.0f};
|
|
||||||
CameraSpringArmComponent->SetRelativeRotation({-90.0, 0.0f, 0.0f});
|
|
||||||
|
|
||||||
// Create Camera
|
|
||||||
CameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera Component"));
|
|
||||||
CameraComponent->SetupAttachment(CameraSpringArmComponent, USpringArmComponent::SocketName);
|
|
||||||
CameraComponent->bUsePawnControlRotation = false;
|
|
||||||
CameraComponent->SetProjectionMode(ECameraProjectionMode::Type::Orthographic);
|
|
||||||
CameraComponent->SetOrthoWidth(4000.0f);
|
|
||||||
|
|
||||||
// Create EXP Component
|
// Create EXP Component
|
||||||
EXPComponent = CreateDefaultSubobject<UEXPComponent>(TEXT("EXP Component"));
|
EXPComponent = CreateDefaultSubobject<UEXPComponent>(TEXT("EXP Component"));
|
||||||
|
|
||||||
|
@ -11,8 +11,6 @@ class UWidgetComponent;
|
|||||||
class UWeaponInventoryComponent;
|
class UWeaponInventoryComponent;
|
||||||
class UGoldComponent;
|
class UGoldComponent;
|
||||||
class UEXPComponent;
|
class UEXPComponent;
|
||||||
class UCameraComponent;
|
|
||||||
class USpringArmComponent;
|
|
||||||
class UInputMappingContext;
|
class UInputMappingContext;
|
||||||
class UInputAction;
|
class UInputAction;
|
||||||
|
|
||||||
@ -25,12 +23,6 @@ class VAMPIRES_API APlayerCharacter : public AVampireCharacter
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
||||||
USpringArmComponent* CameraSpringArmComponent = nullptr;
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
||||||
UCameraComponent* CameraComponent = nullptr;
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
UEXPComponent* EXPComponent;
|
UEXPComponent* EXPComponent;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user