From ZDoom Wiki
Jump to: navigation, search

float GetAngle (int flags [, int ptr_select])


Gets the angle of the calling actor and the pointer.

Note that this function is to be used where an expression is expected. It is mostly useful when combined with A_JumpIf or Anonymous Functions and can be used in place of such functions like A_JumpIfTargetInLOS.


  • flags: Flags can be combined with the | symbol.
    • GAF_RELATIVE: The same as setting relative to true.
    • GAF_SWITCH: Inverses the angle check; equivalent of the pointer executing the function, but the result goes to the calling actor instead.
  • ptr_select: The pointer to examine. Default is AAPTR_TARGET. Must be a pointer other than AAPTR_DEFAULT or AAPTR_NULL. See actor pointers.

Return value

Returns the angle in double floatation precision constricted between [-180.0, 180.0].

I.e. if the pointer is directly south of the caller and the check is non-relative, it will return -90. North is 90. West is 180. East is 0.


Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.