Checking if a unit is facing a point

TideOfChaos

New Member
Reaction score
25
I need a way to see if a unit is facing a point.
More spefically, if it is facing the source of damage.
Or, if it is easier, source of attacker/caster.
 

roXplosive

New Member
Reaction score
15
I think you need a condition like this :

RabsBJ(GetUnitFacing(GetEentDamageSource())-GetUnitFacing(GetTriggerUnit()))==bj_PI

But I guess it wouldn't hurt to make it with an error marje of +- 30 degrees that is bj_PI/6 .
JASS:

 function Event_TargetFacingAttacker_Condition takes nothing returns boolean
return RabsBJ(RabsBJ(GetUnitFacing(GetEventDamageSource())-GetUnitFacing(GetTriggerUnit()))-bj_PI)<=bj_PI/6
endfunction


I hope the people making the GetUnitFacing functions made it return radians like normal people .
 
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