Added hit marker
This commit is contained in:
parent
e109b044fc
commit
a450a7d687
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Player/HUD/WB_MainHud.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Player/HUD/WB_MainHud.uasset
(Stored with Git LFS)
Binary file not shown.
@ -76,6 +76,7 @@ void ALMPlayer::FireBullets(const FLMBulletInfo Settings)
|
|||||||
FVector EndLocation;
|
FVector EndLocation;
|
||||||
FVector ShotVector;
|
FVector ShotVector;
|
||||||
FHitResult OutHit = FHitResult();
|
FHitResult OutHit = FHitResult();
|
||||||
|
bool HitSomething = false;
|
||||||
|
|
||||||
DrawDebugLine(GetWorld(), Settings.Origin, Settings.Origin + (Settings.Direction * Settings.MaxDistance), FColor::Blue, false, 2.f);
|
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<ULMHitBox>(OutHit.Component))
|
if (ULMHitBox* HitBox = Cast<ULMHitBox>(OutHit.Component))
|
||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Hit Hitbox"));
|
UE_LOG(LogTemp, Warning, TEXT("Hit Hitbox"));
|
||||||
|
HitSomething = true;
|
||||||
HitBox->OnHit(Settings);
|
HitBox->OnHit(Settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (HitSomething)
|
||||||
|
{
|
||||||
|
OnEnnemyHit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FVector ALMPlayer::GetWeaponFiringOrigin() const
|
FVector ALMPlayer::GetWeaponFiringOrigin() const
|
||||||
|
@ -67,6 +67,9 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
FVector GetAimVector() const;
|
FVector GetAimVector() const;
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
|
void OnEnnemyHit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
|
||||||
TObjectPtr<ULMWeaponManager> WeaponManager;
|
TObjectPtr<ULMWeaponManager> WeaponManager;
|
||||||
|
Reference in New Issue
Block a user