UnitGetFacing
fixed UnitGetFacing(unit u);
Facing angle of the unit in degrees.
Parameters
- unit u
Unit to get the facing of.
Return value
fixed - Angle in degrees. Between -180° (excluded) and 180°.
Examples
- Example: Sample Usage
unit u = // Fill ... ; int player = // Fill ...; // Point 5 ranges units in front of the unit point targetPoint = PointWithOffsetPolar(UnitGetPosition(u), 5, UnitGetFacing(u)); // Order to move to the wanted point order ord = AICreateOrder(player, "move", 0); OrderSetTargetPoint(ord, targetPoint ); // Tell the unit to go there AICast(u, ord, c_noMarker, true);
- 1 comment
- 1 comment
- Reply
- #1
ShaZe88 Aug 04, 2010 at 19:51 UTC - 0 likesI can't get this function to work properly, I am currently using :
Where unit is the unit I want to get the angle from and angle is the integer returned from the function but it keep giving me syntax error. I also tried different variation such as :