How to rotate and hydrant

gandgand Member Posts: 54
edited November -1 in Working with GS (Mac)


Following this TSB tutorial about to rotate a cannon with min and max, I try to apply it to an hydrant that rotate (with min and max) only when is pressed inside.

I use Rotate to Angle behavior with this expression:
`max(-90,min(0,vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )))`

But it works only the first time I click on it; when I click the second or next time hydrant has strange movements and slide away from when is pressed also going over min and max position.
I published Hydrant rotate test http://gamesalad.com/game/20932 to try it.
Thanks for your help.
Sign In or Register to comment.