Cumulative rotation - confusing me a little

SparkyidrSparkyidr Member, PRO Posts: 2,033
edited November -1 in Working with GS (Mac)
Hopefully someone can point my brain in the right direction with this.

I have an actor, and when I hold a button down, I am getting it to rotate.

Once I let go of the button, I then want the actor to level out (sideways)..this works out as -90 (or 270) degrees.

This is all well and good if I only do a single rotation and let go, and it looks great.

When I hold the button for a number of rotation though, the rotation seens to be cumulative though. So when I let go of the button, and I tell the actor to go back to the level -90 degrees, it spins back round however many rotations I did untill it gets back there rather then just going back to the nearest version of being levelled out.

Is there a funky maths way of doing this.. or will I have to stick a load of "if" statements in my level out rule.

so

if rotation < -360 then rotate to -90
if rotation <-720 then rotate to -450
and so on and so forth
etc etc

Comments

  • Rob2Rob2 Member Posts: 2,402
    If you use 'rotate to angle' relative to scene it should be alright, how are you rotating to start with?
  • SparkyidrSparkyidr Member, PRO Posts: 2,033
    yeah. Just figured out I should use rotate to angle rather than the way I was doing it.

    My initial rotation is just using "rotate". But my "come out of rotation" rule was using an interpolate.
    Replaced that with a rotate to angle, and all is well with the world :)

    I find sometimes it's hard not to over think a problem.
Sign In or Register to comment.