diff --git a/Content/Legumix/Player/BP_Play.uasset b/Content/Legumix/Player/BP_Play.uasset index 7a5efaf..cd9ccf5 100644 --- a/Content/Legumix/Player/BP_Play.uasset +++ b/Content/Legumix/Player/BP_Play.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:47bb60c6a7da0a0032df813250056b6bd664e72e37a0233430d9bdf80d63f5c9 -size 47896 +oid sha256:fb44ad5503f9723d8d3982501153a258736f914ab8d9b7c90fc5107d91ca8d06 +size 60081 diff --git a/Content/Legumix/Player/HUD/WB_MainHud.uasset b/Content/Legumix/Player/HUD/WB_MainHud.uasset index 629dde6..96c7a0f 100644 --- a/Content/Legumix/Player/HUD/WB_MainHud.uasset +++ b/Content/Legumix/Player/HUD/WB_MainHud.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:306941aa22aaa518489a68736a2c9132e4833e8c7ff87d9a23dc89f7d355980b -size 25869 +oid sha256:2e06fcaef99549326fa8abcb7ba18051b9d2463c4d7217af1cf01bf8de3a8907 +size 53918 diff --git a/Source/LegumeMix/Private/Player/LMPlayer.cpp b/Source/LegumeMix/Private/Player/LMPlayer.cpp index 63d08d4..b00c0bd 100644 --- a/Source/LegumeMix/Private/Player/LMPlayer.cpp +++ b/Source/LegumeMix/Private/Player/LMPlayer.cpp @@ -76,6 +76,7 @@ void ALMPlayer::FireBullets(const FLMBulletInfo Settings) FVector EndLocation; FVector ShotVector; FHitResult OutHit = FHitResult(); + bool HitSomething = false; DrawDebugLine(GetWorld(), Settings.Origin, Settings.Origin + (Settings.Direction * Settings.MaxDistance), FColor::Blue, false, 2.f); @@ -97,9 +98,15 @@ void ALMPlayer::FireBullets(const FLMBulletInfo Settings) if (ULMHitBox* HitBox = Cast(OutHit.Component)) { UE_LOG(LogTemp, Warning, TEXT("Hit Hitbox")); + HitSomething = true; HitBox->OnHit(Settings); } } + + if (HitSomething) + { + OnEnnemyHit(); + } } FVector ALMPlayer::GetWeaponFiringOrigin() const diff --git a/Source/LegumeMix/Public/Player/LMPlayer.h b/Source/LegumeMix/Public/Player/LMPlayer.h index 2c66c4a..0093fad 100644 --- a/Source/LegumeMix/Public/Player/LMPlayer.h +++ b/Source/LegumeMix/Public/Player/LMPlayer.h @@ -67,6 +67,9 @@ public: UFUNCTION(BlueprintCallable) FVector GetAimVector() const; + UFUNCTION(BlueprintImplementableEvent) + void OnEnnemyHit(); + private: UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true)) TObjectPtr WeaponManager;