diff --git a/Content/Blueprints/Character/BP_BlasterCharacter.uasset b/Content/Blueprints/Character/BP_BlasterCharacter.uasset index d8f290f..29d515f 100644 Binary files a/Content/Blueprints/Character/BP_BlasterCharacter.uasset and b/Content/Blueprints/Character/BP_BlasterCharacter.uasset differ diff --git a/Content/Maps/Lobby.umap b/Content/Maps/Lobby.umap index a2cec19..af77cde 100644 Binary files a/Content/Maps/Lobby.umap and b/Content/Maps/Lobby.umap differ diff --git a/Content/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.uasset b/Content/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.uasset deleted file mode 100644 index 0af49ed..0000000 Binary files a/Content/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.uasset and /dev/null differ diff --git a/Content/ThirdPerson/Blueprints/BP_ThirdPersonGameMode.uasset b/Content/ThirdPerson/Blueprints/BP_ThirdPersonGameMode.uasset deleted file mode 100644 index 9a447e9..0000000 Binary files a/Content/ThirdPerson/Blueprints/BP_ThirdPersonGameMode.uasset and /dev/null differ diff --git a/Source/Blaster/Character/BlasterCharacter.cpp b/Source/Blaster/Character/BlasterCharacter.cpp index 94ad34a..64abe75 100644 --- a/Source/Blaster/Character/BlasterCharacter.cpp +++ b/Source/Blaster/Character/BlasterCharacter.cpp @@ -3,29 +3,36 @@ #include "BlasterCharacter.h" -// Sets default values +#include "Camera/CameraComponent.h" +#include "GameFramework/SpringArmComponent.h" + + ABlasterCharacter::ABlasterCharacter() { - // Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; + CameraBoom = CreateDefaultSubobject(TEXT("CameraBoom")); + CameraBoom->SetupAttachment(GetMesh()); + CameraBoom->TargetArmLength = 600.f; + CameraBoom->bUsePawnControlRotation = false; + + FollowCamera = CreateDefaultSubobject(TEXT("FollowCamera")); + FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName); + FollowCamera->bUsePawnControlRotation = false; } -// Called when the game starts or when spawned void ABlasterCharacter::BeginPlay() { Super::BeginPlay(); } -// Called every frame void ABlasterCharacter::Tick(float DeltaTime) { Super::Tick(DeltaTime); } -// Called to bind functionality to input void ABlasterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) { Super::SetupPlayerInputComponent(PlayerInputComponent); diff --git a/Source/Blaster/Character/BlasterCharacter.h b/Source/Blaster/Character/BlasterCharacter.h index b3928d8..2d0ba78 100644 --- a/Source/Blaster/Character/BlasterCharacter.h +++ b/Source/Blaster/Character/BlasterCharacter.h @@ -12,18 +12,19 @@ class BLASTER_API ABlasterCharacter : public ACharacter GENERATED_BODY() public: - // Sets default values for this character's properties ABlasterCharacter(); - + virtual void Tick(float DeltaTime) override; + virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; + protected: - // Called when the game starts or when spawned virtual void BeginPlay() override; -public: - // Called every frame - virtual void Tick(float DeltaTime) override; - - // Called to bind functionality to input - virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; +private: + UPROPERTY(VisibleAnywhere, Category="Camera") + class USpringArmComponent* CameraBoom; + UPROPERTY(VisibleAnywhere, Category="Camera") + class UCameraComponent* FollowCamera; +public: + };