I am making a map that considers 3d positions of units, and I have a spell that creates an explosion. So, I wanted to ask how heavy it is for performance to select units in the sphere for the purpose of KB and Damage and what is the best way to do it?
Edit: After thinking a little bit more about it, I can just check for the distance between the unit's z and explosion z:
Edit: After thinking a little bit more about it, I can just check for the distance between the unit's z and explosion z:
JASS:
function GetDistBetweenXY3d takes real x, real y, real z, real x2, real y2, real z2 returns real
local real dx = x2 - x
local real dy = y2 - y
local real dz = z - z2
return SquareRoot(( dx * dx ) + ( dy * dy ) + ( dz * dz ))
endfunction
Last edited: