diff --git a/Content/Blueprints/Items/RevolverGun.uasset b/Content/Blueprints/Items/RevolverGun.uasset index 4549f1f..2201e69 100644 Binary files a/Content/Blueprints/Items/RevolverGun.uasset and b/Content/Blueprints/Items/RevolverGun.uasset differ diff --git a/Content/Blueprints/Items/ShotGun.uasset b/Content/Blueprints/Items/ShotGun.uasset index 7a5fef4..e732e7d 100644 Binary files a/Content/Blueprints/Items/ShotGun.uasset and b/Content/Blueprints/Items/ShotGun.uasset differ diff --git a/Content/Levels/TestMap.umap b/Content/Levels/TestMap.umap index 2c652fb..609f87a 100644 Binary files a/Content/Levels/TestMap.umap and b/Content/Levels/TestMap.umap differ diff --git a/Source/Exo/Private/Items/GunBase.cpp b/Source/Exo/Private/Items/GunBase.cpp index 8d66773..dfd456f 100644 --- a/Source/Exo/Private/Items/GunBase.cpp +++ b/Source/Exo/Private/Items/GunBase.cpp @@ -3,6 +3,8 @@ #include "Items/GunBase.h" +#include "Characters/Components/ShootingComponent.h" + // Sets default values AGunBase::AGunBase() { @@ -25,3 +27,9 @@ void AGunBase::Tick(float DeltaTime) } +void AGunBase::Interact_Implementation(AExoPlayerCharacter* playerCharacter) +{ + playerCharacter->ShootingComponent->PickUpGun(this); + + Destroy(); +} \ No newline at end of file diff --git a/Source/Exo/Public/Items/GunBase.h b/Source/Exo/Public/Items/GunBase.h index 493318c..8bea1ba 100644 --- a/Source/Exo/Public/Items/GunBase.h +++ b/Source/Exo/Public/Items/GunBase.h @@ -4,10 +4,11 @@ #include "CoreMinimal.h" #include "GameFramework/Actor.h" +#include "Interfaces/Interactable.h" #include "GunBase.generated.h" UCLASS() -class EXO_API AGunBase : public AActor +class EXO_API AGunBase : public AActor, public IInteractable { GENERATED_BODY() @@ -44,4 +45,5 @@ public: // Called every frame virtual void Tick(float DeltaTime) override; + virtual void Interact_Implementation(AExoPlayerCharacter* playerCharacter) override; };