• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Find Distance between 2 Units?

Status
Not open for further replies.
Level 15
Joined
Aug 11, 2009
Messages
1,606
Hi,

I need to be able to detect the distance between one unit and another.

Then If distance between 2 units is greater than 300.. etc...

Rep to whoever finds solution

Hmmm,how about doing something like this?Set to A a unit's position X,Y.
Then set to B another unit's position X,Y.

Then do something like A - B and find the difference between?
 
Level 11
Joined
Jun 21, 2007
Messages
505
There's a function:
Real Value - Math - Distance Between Points.

There's also angle between points. But you got to keep the order. If you do from one point to second point, then it will be some angle. If you do from second point to first point, then the angle will be different.
 
Status
Not open for further replies.
Top