kontiuka Posted December 10, 2014 Posted December 10, 2014 I'm trying to use this function to check if a unit is dead. As I understand it, it should return <= 1.0 if the unit is dead. I killed a unit and checked the return value and it gave me 32. Before I killed it, the function returned 3. Also, does this function work with air units? Everytime I try to check the life of an air unit that has crashed, I get lua error "Unit doesn't exist". 1
piXel496 Posted December 11, 2014 Posted December 11, 2014 Objects that are destroyed (dead) are gone or become a new (burned out casco) object so there original body does not exist anymore. Maybe something like this could help: if someObject == nil or someObject:getLife() <= 1 then etc.. :noexpression: old stuff I made
Recommended Posts