Hitscan

Hitscan is a process in which a weapon is fired, and instantly deals damage to whatever object is in front of it.

The following weapons use hitscan:


 * Lasgun
 * Shotgun
 * Mass Driver
 * Rifle
 * Chaingun

From a programmer's point of view, this kind of shot is the simplest. It mainly uses a "raycast" which is a method to calculate an imaginary ray from one 3D position to another 3D position. It can be used, for example, to determine the first obstacle between the two points and the exact 3D position of the impact point.

The "raycast" method is very important for 3D games. It is used, for example, to determine if an object or enemy can be seen by you - or if an enemy can see you.

Because it is such a rudimentary and widely used function, we have this neverending flood of 3D shooter games, because guess what function is used to calculate the path from gun to target. Makes you wish there were a "intelligent game idea" function.