terça-feira, 30 de maio de 2017

BP Compendium 3: Apply Damage

Apply Damage


This function is used to apply damage to an Actor. Various information related to the damage can be passed through the function. The hit Actor responds to this damage using the "AnyDamage" event.

Input
  • Damaged Actor: Reference to the Actor who will suffer the damage.
  • Base Damage: Value of float type that represents the damage.
  • Event Instigator: Optional. Reference to the Controller responsible for the damage.
  • Damage Causer: Optional. Reference to the Actor which caused the damage.
  • Damage Type Class: Optional. Class that represents the type of damage. E.g. Fire, Electricity.

Example Usage: 

This simple example can be used on a blueprint that represents a bullet. When the bullet hits an Actor, the "Apply Damage" function is used to deal a damage with a value of 20. After that the bullet is destroyed.

Click to enlarge

In the Actor Blueprint that was hit, a float variable with the name "Energy" was created. The "AnyDamage" event will be activated by the "Apply Damage" function. The damage is subtracted from the "Energy" variable. If "Energy" is less than or equal to zero, the Actor will be destroyed.

Click to enlarge

There are more specific versions such as the "Apply Point Damage" and "Apply Radial Damage" functions. For each of them there is an associated event.


Table of Contents