I'm assuming your frames are numbered 1 to 8, with the car rotating clockwise at 45 degree increments, starting with it facing directly upwards.
Try this code, in the car's object actions:
There might well be a simpler way to do this, but I'm relying on my feeble mathematical abilities...Code:diffx = _x - _root._xmouse; diffy = _y - _root._ymouse; a=((Math.atan (diffy/diffx)) * (180/Math.PI)) + 90; if (diffx >= 0) { a+=180; } frameNum = math.floor(((math.floor(a/22.5) + 1)%16)/2)+1; this.gotoAndStop(frameNum);![]()




Reply With Quote