# Mouse Follow Rotation Limits

**URL:** <https://forum.kirupa.com/t/mouse-follow-rotation-limits/197004>\
**Category:** flash\
**Created:** [August 12, 2006, 4:31pm UTC](https://forum.kirupa.com/t/mouse-follow-rotation-limits/197004 "2006-08-12T16:31:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scarce](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@scarce](https://forum.kirupa.com/u/scarce)\
**Post date:** [August 12, 2006, 4:31pm UTC](https://forum.kirupa.com/t/mouse-follow-rotation-limits/197004/1 "2006-08-12T16:31:20Z")

</div>

I’m currently working on a game where I have a movieclip that rotates based on \_xmouse.

* * *

```auto

this.onEnterFrame = function() {
	//Mouse
	__________________________________ ;
	Mouse.hide();
	__________________________________ ;
	this.shooter._rotation = 0;
	this._xmouse = 100
	if (this.shooter._rotation>-90 & this.shooter._rotation<90) {
		this.shooter._rotation += _root._xmouse/2;
	} else if (this.shooter._rotation<-90 & this.shooter._rotation>90) {
		this.shooter._rotation = _root._xmouse/2;
	}
};

```

* * *

mouse this allows the rotation to follow the mouse, but I can’t figure out how to set limitations for it. The min value should be -90 and the max should be 90.

Thanks for those who help me.
