Xilandro Posted January 12, 2014 Share Posted January 12, 2014 I need to find the offset in degrees between two Z-angles. Ref01 Z-angle and Ref02 Z-angle, so i will be able to change Ref02 Z-angle and animate it, if Ref01 Z-angle is more than 45 or -45 degrees relative to Ref02 Z-angle o_O I've tried to find out, but failed =\ just exaple what i want to achieve: if difference == -45 Ref02.TurnLeftAnimation endif if difference == 45 Ref02.TurnRIghtAnimation endif Link to comment Share on other sites More sharing options...
rickerhk Posted January 12, 2014 Share Posted January 12, 2014 The Z angle in the game is a bearing, not a trig angle. It's 0 - 360 going clockwise, but that shouldn't matter in this case. float fRef01AngleZ float fRef02AngleZ float fAngleDifference set fRef01AngleZ to Ref01.GetAngle Z set fRef02AngleZ to Ref02.GetAngle Z set fAngleDifference to fRef01AngleZ - fRef02AngleZ if (fAngleDifference > 45) ;do stuff elseif (fAngleDifference < -45) ;do stuff endif Link to comment Share on other sites More sharing options...
Xilandro Posted January 12, 2014 Author Share Posted January 12, 2014 Nope. It was the first thing i've tried. It will not work. Link to comment Share on other sites More sharing options...
Xilandro Posted January 13, 2014 Author Share Posted January 13, 2014 bump =\ Link to comment Share on other sites More sharing options...
Recommended Posts