Be an Angel fix my ngle. Stop rotating the long way round to a given angle?

StormyStudioStormyStudio United KingdomMember Posts: 3,989
edited November -1 in Working with GS (Mac)
Ok, so I'm at work at the moment and not able to carry on testing this, but if anyone knows the way to solve my problem then I can be super productive tonight...

The Problem:
I've setup the actor to rotate to the angle of the destination its travelling to. I get the angle correctly and it all looks as if its working fine. Though if I click a certain direction the angle must just from 270 to 10, and instead of rotating the shorter path, it spins back round the long way, which just looks a bit stupid.

What I've got setup for rotate to angle:

I've got an actor who moves to touch. (there is a camera offset setup to keep touch working properly as the scene is larger than the viewer window).

Interpolate to angle over a set duration (1 second).

I find the angle by:
Change attribute: ...self.angle..... to .....'vector to angle(game.touch x with offset - self.position X, game.touch Y with offset - selp.position Y).

Then an extra rule to try and stop the crazyness....
if... self.angle is less than or equal to 0
change attribute:...self angle to self.angle +360
Sign In or Register to comment.