- Joined
- Jul 5, 2010
- Messages
- 1,132
I need a trigger to calculate position and facing interaction between two units. Is unit behind another unit, in front of it, or behind it?
My idea is to calculate the difference between the Facing angle of Unit 1 and Angle between unit 1 and unit 2, and just see if it is etc. less than 60, unit is in front or greater than 120 the unit is behind.
The problem is that World Editor returns one value between 0 and 360, and the other one between -180 and 180.
Please, I tried several times, and failed each and every time, so I really need help with this. Thankful in advance
My idea is to calculate the difference between the Facing angle of Unit 1 and Angle between unit 1 and unit 2, and just see if it is etc. less than 60, unit is in front or greater than 120 the unit is behind.
The problem is that World Editor returns one value between 0 and 360, and the other one between -180 and 180.
Please, I tried several times, and failed each and every time, so I really need help with this. Thankful in advance