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 (Hit.GetActor())
|
||||||
{
|
{
|
||||||
|
if (auto interactableComponent = Hit.GetActor()->GetComponentByClass<UInteractableComponent>())
|
||||||
|
{
|
||||||
|
interactableComponent->Interact();
|
||||||
|
}
|
||||||
|
|
||||||
if (Hit.GetActor()->ActorHasTag("Enemy"))
|
if (Hit.GetActor()->ActorHasTag("Enemy"))
|
||||||
{
|
{
|
||||||
// TODO: Do thing
|
// TODO: Do thing
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "Engine/DamageEvents.h"
|
#include "Engine/DamageEvents.h"
|
||||||
#include "Blueprint/UserWidget.h"
|
#include "Blueprint/UserWidget.h"
|
||||||
#include "Perception/AIPerceptionStimuliSourceComponent.h"
|
#include "Perception/AIPerceptionStimuliSourceComponent.h"
|
||||||
|
#include "InteractableComponent.h"
|
||||||
#include "PlayerCharacter.generated.h"
|
#include "PlayerCharacter.generated.h"
|
||||||
|
|
||||||
class UInputAction;
|
class UInputAction;
|
||||||
|
|
Loading…
Reference in New Issue