diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index 6a7ace7..6710218 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -40,6 +40,8 @@ void ATempCharacter::BeginPlay() Enemy = TEXT("Enemy"); UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors); + + Ammo = TEXT("Ammo"); } //Binds the input we made in the setup player component to the forward vector @@ -150,6 +152,10 @@ void ATempCharacter::LineTraceLogic() { UE_LOG(LogTemp, Display, TEXT("Not Enough Gold")); } + if(OutHit.GetActor()->ActorHasTag(Ammo)) + { + OutHit.GetActor()->Destroy(); + } } // if the actor hit has the interaction component/script then it will activate the code diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h index 44ba91e..57675b2 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h @@ -93,4 +93,6 @@ public: FName Enemy; + FName Ammo; + };