- Joined
- Jan 23, 2015
- Messages
- 788
Hey guys, I know the complicated way to calculate the closest unit of a point (by storing all units nearby in a variable with an index and comparing the distance), but isn't there a simplier way?
edit:
This should perfectly work right?
edit:
This should perfectly work right?
-
Unit Group - Pick every unit in UnitsNearby and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between (Position of (Picked unit)) and TempPoint1) Less than Distance
-
Then - Actions
- Set Distance = (Distance between (Position of (Picked unit)) and TempPoint1)
- Set Target = (Picked unit)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
Last edited: