Page 1 of 1

Distance() for coordinates only?

Posted: Sun Apr 15, 2007 5:41 am
by Naglfar
I need to calculate distance between MOBILE and STATIC in some scripts, so I can't use Distace() function, because it calculates only distance between two objects. (Solution is to put a coin item at location of static, chceck Distance(), and remove the coin... But this is a lot of additional calculations in a loop.)


How should look function like Distance(x1, y1, x2, y2)?
I've tried use this
Image
but this function does'nt work proper in some cases.


Does anyone know what calculations sholud I do to check distance betwen two coorditanes like in Distance()?

Posted: Sun Apr 15, 2007 6:29 am
by Pierce
You can use
CoordinateDistance(x1, y1, x2, y2);
if that is what you search.

Posted: Sun Apr 15, 2007 7:09 am
by Naglfar
Next time I should check documentation precisely... Yep, thats what I need, thanks.