Jump to content

Recommended Posts

Posted

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".

  • Like 1
Posted

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:

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...