MCPcopy Create free account
hub / github.com/DruidMech/UE5_TheUltimateDeveloperCourse / TakeDamage

Method TakeDamage

Source/Slash/Private/Enemy/Enemy.cpp:52–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52float AEnemy::TakeDamage(float DamageAmount, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser)
53{
54 HandleDamage(DamageAmount);
55 CombatTarget = EventInstigator->GetPawn();
56
57 if (IsInsideAttackRadius())
58 {
59 EnemyState = EEnemyState::EES_Attacking;
60 }
61 else if (IsOutsideAttackRadius())
62 {
63 ChaseTarget();
64 }
65
66 return DamageAmount;
67}
68
69void AEnemy::Destroyed()
70{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected