User Tools

Site Tools


modding:function:syscalcfiresolution

This is an old revision of the document!


Discuss this page on this pages TalkPage

sysCalcFireSolution

See sysCalcFireSolution at Xelerus

Syntax (sysCalcFireSolution targetPos targetVel speed) 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 sysCreateWeaponFire. Automactically 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

modding/function/syscalcfiresolution.1331947122.txt.gz · Last modified: 2014/12/27 04:40 (external edit)