The first level of definition for a Unit. Hold all informations related to health points and damages.
Variables
hitLife:Float
[HostOnly] The quantity of damage a unit received. 0 means full health. A hitLife of 1 is equivalent to 25 in-game health point.
read onlylife:Float
The remaining life of a unit after applying the damages. A life of 1 is equivalent to 25 in-game health point.
read onlymaxLife:Float
The maximum damage a unit can take before passing away. A maxLife of 1 is equivalent to 25 in-game health point.
scriptVisible:Bool
Remove a unit from the rendering process. The units is still active and seletable.
Methods
die(?immediate:Bool, ?playDeath:Bool):Void
[HostOnly] Kills the unit. Buildings will explode, while standard units can either immediately vanish or die with their animation.
Parameters:
immediate | true to remove the unit from the world, false to have it play the death animation. |
---|---|
playDeath | true to play the death sound of civilian units |