T2dGunTurret turning into wrong direction
by Shaderman · in Torque Game Builder · 08/22/2008 (5:24 am) · 2 replies
Hi,
I've made some test with t2dGunTurret but it doesn't face the target object correctly:
youtube video
Unfortunately, I don't have the TGB source (yet) and there are no docs about this class. Any ideas how to solve this?
I've made some test with t2dGunTurret but it doesn't face the target object correctly:
youtube video
Unfortunately, I don't have the TGB source (yet) and there are no docs about this class. Any ideas how to solve this?
#2
I just tried to use the t2dGunTurret class like Melv did in his post and didn't calculate anything myself. I assume it's a bug and thus I'll use something like your code and do the calculation on my own. It's not a big deal, I've just been curious and thought there might be an easy solution or some infos about this class or active tiles in general.
Thanks.
Stefan
09/04/2008 (9:25 am)
Thanks for your answer Ehrlichmann.I just tried to use the t2dGunTurret class like Melv did in his post and didn't calculate anything myself. I assume it's a bug and thus I'll use something like your code and do the calculation on my own. It's not a big deal, I've just been curious and thought there might be an easy solution or some infos about this class or active tiles in general.
Thanks.
Stefan
Torque Owner Ehrlich
well... a simple solution to your case (for what i could see in your video) is to add (or substract) 180 degrees to the angle your calculating for the turret to face the enemy (player), and you're set.
edit: somethin like this is what you need...
there are some values that you dont really need, but i think you get the idea (thats a lil snippet i used to code a function for a homming missile).
with that "%angle" your turret should face the enemy correctly.