Originally Posted by Gello
UnitDistanceSquared is, as it says, the distance from you to the unit, squared. If your friendly target is 50 yards away, UnitDistanceSquared("target") returns 2500. I've not done any debugprofilestop testing on it to tell if it's faster than (x2-x1)^2 + (y2-y1)^2, but it's very likely.
|
I wonder why they're not doing the final step of that equation to give us 50 instead of 2500? Is there any situation where you'd actually want the squared distance, and wouldn't just be immedately doing (value ^ 0.5) in your code?