Discuss this page on this pag's [[sysCalcFireSolution Talk Page|Talk Page]] === sysCalcFireSolution === See [[http://xelerus.de/index.php?s=functions&function=356|sysCalcFireSolution at Xelerus]] ^ Syntax | (sysCalcFireSolution targetPos targetVel speed) -> angle or nil | ^ Arguments | targetPos: the vector position of the target | ^ | targetVel: the vector velocity of the target | ^ | speed: the speed of the projectile | ^ Returns | angle or nil | ^ Category | math, weapon | ^ Description | A very useful function when using [[modding/function/syscreateweaponfire|sysCreateWeaponFire]]. | Automatically performs all trigonometry required to properly lead a target (assuming it moves in a straight line at constant speed) === Example === (sysCalcFireSolution (objGetpos aTargetobj) (objGetVel aTargetObj) (objGetVel gPlayerShip)) Will return the correct angle to fire a projectile in order to hit aTargetObj Return to [[:Functions]] list