diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index db3f6fe..34cde4f 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -279,6 +279,11 @@ void APlayerCharacter::ProcessHits(TArray hits) if (Hit.GetActor()) { + if (auto interactableComponent = Hit.GetActor()->GetComponentByClass()) + { + interactableComponent->Interact(); + } + if (Hit.GetActor()->ActorHasTag("Enemy")) { // TODO: Do thing diff --git a/Source/Nakatomi/PlayerCharacter.h b/Source/Nakatomi/PlayerCharacter.h index d9b48ad..599dfbe 100644 --- a/Source/Nakatomi/PlayerCharacter.h +++ b/Source/Nakatomi/PlayerCharacter.h @@ -13,6 +13,7 @@ #include "Engine/DamageEvents.h" #include "Blueprint/UserWidget.h" #include "Perception/AIPerceptionStimuliSourceComponent.h" +#include "InteractableComponent.h" #include "PlayerCharacter.generated.h" class UInputAction;