Get all units within cone

martix

There is no spoon
Reaction score
49
> It's also not working...
Mind expanding on that? I was under the assumption it would work.
The range, as with any arc function is in degrees, in this case for tangent [-180;180]
Other than perhaps atan2 not doing what I think its doing, I do not see what else could be wrong.
If I am using it wrong, an explanation on what exactly it does would be in order.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Mind expanding on that?


Code:
Or - Any (Conditions) are true
    Conditions
        (Atan2(UnitY, UnitX)) Less than or equal to (FaceAngle + (DetectionAngle / 2.00))
        (Atan2(UnitY, UnitX)) Greater than or equal to (FaceAngle - (DetectionAngle / 2.00))

"Or" is probably not a good condition when looking for something that needs to be within two limits.


> Atan2(UnitY, UnitX)

That's the angle from the center of the map to the unit... doesn't make much sense.


Just "angle - ..." and "angle + ..." won't do around 0. See post #20.


"Atan2" also returns an angle between -180 and +180. "Facing of unit" from 0 to 360.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top