• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

how to check if unit is dead

Status
Not open for further replies.
JASS:
if IsUnitType(u, UNIT_TYPE_DEAD) or GetUnitTypeId(u) == 0 then
    // unit is dead
endif
Using condition above you can always be sure unit is dead because there are rare issues in which GUI is alive/is dead can be buggy, although here are some other psibilities if don't care about those 'rare situations':
JASS:
local unit u = //unit here
if GetWidgetLife(u) < 0.405 then
    // unit is dead
endif
set u = null

GUI (without custom scripts):
  • ((Triggering unit) is dead) Equal to True
OR
  • ((Triggering unit) is alive) Equal to False
 
Last edited:
Status
Not open for further replies.
Top