Flip a unit's angle across its X axis

dashival

New Member
Reaction score
11
What I want to do is have the unit facing the same degree north/south, but flip its east/west angle. Is that possible? Like, if the unit is facing angle 45, I want it to flip to 135.
 
A

Aw2k6

Guest
dashival said:
What I want to do is have the unit facing the same degree north/south, but flip its east/west angle. Is that possible? Like, if the unit is facing angle 45, I want it to flip to 135.

if Angle < 90
set Angle = Angle + 90
else
....

Just make conditions detecting which quadrant it's in and add or subtract the correct amount. That's the first thing that came to my mind.
 

dashival

New Member
Reaction score
11
If the angle were 80, that would add 90, making it 170, which is not right.

I think, I can do what you said, except instead of adding 90, add the difference between 90 and the current angle? Would that work?
 
A

Aw2k6

Guest
dashival said:
If the angle were 80, that would add 90, making it 170, which is not right.

I think, I can do what you said, except instead of adding 90, add the difference between 90 and the current angle? Would that work?


Err.. yeah. I don't know why I said -90... 180-Angle. Hopefully you can figure out the other 3 quadrants, they're are similar.
 

dashival

New Member
Reaction score
11
So then, if the angle was 0, and you subtracted 180, it'd be -180? Does WC automatically just convert that to 360 and down, instead of going into negatives?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top