# Rotation resets after -180 degrees?!

**URL:** <https://forum.kirupa.com/t/rotation-resets-after-180-degrees/259570>\
**Category:** Uncategorized\
**Created:** [May 6, 2008, 7:42pm UTC](https://forum.kirupa.com/t/rotation-resets-after-180-degrees/259570 "2008-05-06T19:42:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThePuzzleMaster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thepuzzlemaster/32/972_2.png) [@ThePuzzleMaster](https://forum.kirupa.com/u/ThePuzzleMaster)\
**Post date:** [May 6, 2008, 7:42pm UTC](https://forum.kirupa.com/t/rotation-resets-after-180-degrees/259570/1 "2008-05-06T19:42:14Z")

</div>

I’ve got a circular object that I need to rotate to various preset rotations. All negative values. (although it seems to behave the same way with positive values as well). The problem is that I would like to ease the rotations, and whenever the rotation value for the movieclip goes below -180 it resets to a positive value! (i.e. -193 instantly becomes 167) This creates an infinitely spinning movieclip as it never reaches its intended rotation!

Does anyone know of any work arounds around this? I tried putting in this line of code:

```auto

//spinDiff is the amount of rotation that the movieclip is about to rotate
//spinFinal is the endpoint rotation value, where it should stop spinning
if(movieClip.rotation+spinDiff<-180){
     spinFinal = 360+spinDiff
}

```

This code sort of works, but whenever it crosses over it does over 180 degrees of rotation to get to the final value, but at least it stops spinning.

I can’t come up with a solution!

Any help or suggestions are appreciated!

Thanks,  
iLan
