# Help Me With a Rotating Object

**URL:** <https://forum.kirupa.com/t/help-me-with-a-rotating-object/174011>\
**Category:** flash\
**Created:** [January 1, 2006, 8:02pm UTC](https://forum.kirupa.com/t/help-me-with-a-rotating-object/174011 "2006-01-01T20:02:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonathanCarter](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@JonathanCarter](https://forum.kirupa.com/u/JonathanCarter)\
**Post date:** [January 1, 2006, 8:02pm UTC](https://forum.kirupa.com/t/help-me-with-a-rotating-object/174011/1 "2006-01-01T20:02:27Z")

</div>

I am frought with problems every step of the way! Thanks The Canadian for helping me with my last one.  
So I am making this side scroller game and I have this guy who I want to aim at the mouse (so he can shoot where you are aimng). He has a gun and he needs to rotate it so that it points at the mouse. I got this tutorial about the trigonometry etc but I didn’t understand much of it since trigonometry is next semester for me. Despite my limited understanding of the math I was able to reproduce the simple rotating effect,  
BUT  
Whenever I added it to my game engine it suddenly behaved erratically and rotated the gun completely wrong. To see what I am talking about:

[FLA](http://wheresthepineapple.com/bbsadfkblasdg.zip)  
[SWF](http://wheresthepineapple.com/bbsadfkblasdg.swf)

So can somebody please figure out why it doesn’t rotate correctly?  
I’ll put you in the credits if this game ever sees the light of day (I am a notorious quitter).

ABOUT THE FLA  
The little ball is just where I am keeping the gravity code until I impliment it.  
The green dot on his neck is where the script to rootate the gun is.  
The code to make him run around is on the frame.
