UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a Procedural Dismemberment script"
// Called when the character takes damage void ACharacter::TakeDamage(float Damage, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser) { // Calculate the amount of damage to apply to each body part float HeadDamage = Damage * HeadDamageMultiplier; float TorsoDamage = Damage * TorsoDamageMultiplier; float ArmsDamage = Damage * ArmsDamageMultiplier; float LegsDamage = Damage * LegsDamageMultiplier; // Apply the damage to each body part Head->TakeDamage(HeadDamage, DamageEvent, EventInstigator, DamageCauser); Torso->TakeDamage(TorsoDamage, DamageEvent, EventInstigator, DamageCauser); LeftArm->TakeDamage(ArmsDamage, DamageEvent, EventInstigator, DamageCauser); RightArm->TakeDamage(ArmsDamage, DamageEvent, EventInstigator, DamageCauser); LeftLeg->TakeDamage(LegsDamage, DamageEvent, EventInstigator, DamageCauser); RightLeg->TakeDamage(LegsDamage, DamageEvent, EventInstigator, DamageCauser); }