Movement Question

conrad74conrad74 Member Posts: 50
edited November -1 in Working with GS (Mac)
I want to be able to rotate the actor in 90 degree increments using the left and right keyboard key only. For example, every time you press the "left" keyboard key, the actor will rotate counter-clockwise in 90 degree increments. If the actor is at 0 degrees and you press the "right" keyboard button, I want the actor to instantly be at 90 degrees (not move to 90 degrees). Please advise. Thanks!

Comments

  • ORBZORBZ Member Posts: 1,304
    I think your bearings are off. If you are at 0 and push right you will be at 270.

    Anyhow, to do what you want:

    Rule key = left
    Self.rotation = self.rotation + 90

    Rule key right
    Self.rotation = self.rotation - 90

    :)
  • conrad74conrad74 Member Posts: 50
    Thanks for simplifying this for me. I realize I will missing the second "self rotation" in each.
Sign In or Register to comment.