From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.

bool CheckLOF([int flags[, double range[, double minrange[, double angle[, double pitch[, double offsetheight[, double offsetwidth[, int ptr_target[, double offsetforward]]]]]]]]])


Fires out a hitscan ray from the Actor towards its specified target to check if it has a line of fire.


  • flags - 0 by default. The flags to use when checking if a blocking actor should be ignored or not.
  • range - 0 by default. The max range of the hitscan ray. If 0, uses the default hitscan range for attacks.
  • minrange - 0 by default. If greater than 0, the minimum range the hitscan ray must travel for it to be considered valid.
  • angle - 0 by default. The angle offset to apply to the aim.
  • pitch - 0 by default. The pitch offset to apply to the aim.
  • offsetheight - 0 by default. The vertical amount to offset the hitscan origin by.
  • offsetwidth - 0 by default. The sideways amount to offset the hitscan origin by. Positive values shift right while negative values shift left.
  • ptr_target - AAPTR_DEFAULT is the default. Which of the Actor's pointers it should aim at.
  • offsetforward - 0 by default. The forwards amount to offset the hitscan origin by.

Return value

Returns true if the specified target was hit.


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 contributions are greatly appreciated.