Basically Im trying find a way to calculate the direction I need to face from having the first coord to the next coord in a 360 degree view.
Im finding it quite difficult to write a routine that takes coordinates from a game, puts them into an array then retraces back over them. Actaully the only hard part is getting the script to "face" the direction I want it to go. Its a 3 dimentional game in a 3rd person view. Im reading packets and only have the heading of which im facing, x coord, y coord and z coord. I know that if I can save coord X and Y walk away and do some trig I can make my heading point directly back to the X and Y that I saved (but I dont know the trig :/ )
Just in case anyone was wondering, I figured it out... you have to take X1 - X2 and Y1 - Y2 then take those results (X3 , Y3) and divide X3 by Y3 or Y3 by X3 (depending on which one is greater) then Divide 180 by PI and the direction Im looking for is ArcTan of X3 / Y3 * ( 180 / PI )
direction = atan((y3/x3) * (180/3.1415))