goddamn i still fail on this... i got it to align it on 3 sides, but the fourth is still ... WRONG...
code so far..:
i dont get it... lol why only on 3 sides?!Code:a = vectorToAngles( vectorNormalize( playerForward - vectorScale( tankUp , vectorDot( tankUp , playerForward ) ) ) ); //this projects the playerForward to the tanks x/y-plane r = vectorToAngles( tankUp - towerUp ); tower rotateTo( ( a[0] , a[1] , r[0] ) , 0.1, 0 , 0 );
green: tank angles
blue: tower angles
pink: player forward
yellow: projected player forward on tanks xy plane
numbers: r[0]
Attachment 478



Reply With Quote