diff --git a/Source/vampires/PlayerCharacter.cpp b/Source/vampires/PlayerCharacter.cpp index dbd6891..d394e3d 100644 --- a/Source/vampires/PlayerCharacter.cpp +++ b/Source/vampires/PlayerCharacter.cpp @@ -39,9 +39,6 @@ APlayerCharacter::APlayerCharacter() // Create Gold Component GoldComponent = CreateDefaultSubobject(TEXT("Gold Component")); - //Create Weapon Inventory Component - WeaponInventoryComponent = CreateDefaultSubobject(TEXT("Weapon Inventory Component")); - // Create HealthBar Widget Component HealthBarWidgetComponent = CreateDefaultSubobject(TEXT("Healthbar")); HealthBarWidgetComponent->SetupAttachment(RootComponent); diff --git a/Source/vampires/PlayerCharacter.h b/Source/vampires/PlayerCharacter.h index 2b9c028..f28f2b8 100644 --- a/Source/vampires/PlayerCharacter.h +++ b/Source/vampires/PlayerCharacter.h @@ -37,9 +37,6 @@ public: UPROPERTY(EditAnywhere, BlueprintReadWrite) UGoldComponent* GoldComponent; - UPROPERTY(EditAnywhere, BlueprintReadWrite) - UWeaponInventoryComponent* WeaponInventoryComponent; - FVector2D PreviousMovementDirection = FVector2d(1.0f, 0.0f); UPROPERTY(EditAnywhere) diff --git a/Source/vampires/VampireCharacter.cpp b/Source/vampires/VampireCharacter.cpp index 76df70b..84e73dd 100644 --- a/Source/vampires/VampireCharacter.cpp +++ b/Source/vampires/VampireCharacter.cpp @@ -5,6 +5,7 @@ #include "HealthComponent.h" #include "PaperFlipbookComponent.h" +#include "WeaponInventoryComponent.h" // Sets default values AVampireCharacter::AVampireCharacter() @@ -19,6 +20,9 @@ AVampireCharacter::AVampireCharacter() PaperFlipbookComponent->SetRelativeRotation(FRotator(0.0f, 90.0f,-90.0f)); PaperFlipbookComponent->SetRelativeScale3D(FVector(0.2f, 0.2f, 0.2f)); PaperFlipbookComponent->SetupAttachment(RootComponent); + + //Create Weapon Inventory Component + WeaponInventoryComponent = CreateDefaultSubobject(TEXT("Weapon Inventory Component")); } // Called when the game starts or when spawned diff --git a/Source/vampires/VampireCharacter.h b/Source/vampires/VampireCharacter.h index b45bd52..5564c0c 100644 --- a/Source/vampires/VampireCharacter.h +++ b/Source/vampires/VampireCharacter.h @@ -7,6 +7,7 @@ #include "GameFramework/Character.h" #include "VampireCharacter.generated.h" +class UWeaponInventoryComponent; class UInputAction; class UHealthComponent; class UPaperFlipbookComponent; @@ -26,6 +27,9 @@ protected: UPROPERTY(EditAnywhere, BlueprintReadWrite) TObjectPtr InputMappingContext; + + UPROPERTY(EditAnywhere, BlueprintReadWrite) + UWeaponInventoryComponent* WeaponInventoryComponent; public: // Sets default values for this character's properties