Im making a game simular to subspace but top down 3d but Im having a prob with this hardpoint placement function. As I turn the ship and fire the hardpoint moves in an elipical way from left to right. also the odd thing is if I increase the value of hpx# instead of moving more to the left or right of the center of the ship it lengthens the elipical orbit.
I know my trig is horrible
function HPplacement(obj,baseobj,hpx#,hpy#,hpz#) `x-left to right y-fore to back z-above to below
position object obj,object position x(baseobj)+sin(wrapvalue(-object angle z(baseobj)))*hpx#,object position y(baseobj)+sin(wrapvalue(-object angle x(baseobj)))*hpy#,-hpz#
endfunction