Add Interactable Actor Component interaction on weapon hit
This commit is contained in:
parent
7256afd8bf
commit
705d46820c
|
@ -279,6 +279,11 @@ void APlayerCharacter::ProcessHits(TArray<FHitResult> hits)
|
|||
|
||||
if (Hit.GetActor())
|
||||
{
|
||||
if (auto interactableComponent = Hit.GetActor()->GetComponentByClass<UInteractableComponent>())
|
||||
{
|
||||
interactableComponent->Interact();
|
||||
}
|
||||
|
||||
if (Hit.GetActor()->ActorHasTag("Enemy"))
|
||||
{
|
||||
// TODO: Do thing
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue