Rotate Actor to direction of movement

markfrancombemarkfrancombe Member Posts: 8
edited November -1 in Working with GS (Mac)
Hi,

Newb here, but loving GS so far!

My game is a top down view and the actor is walking via left right up down keys (And hopefully accelerometer, but havent tested that yet)

I need the character (an insect) to change direction to face the way it is walking.

HOW PLEASE???

I managed to do this when I wanted movement to be by a touch and move towards, but not this way...

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    You could use the "Rotate to Angle" behavior.

    Rotate to:
    90 for up arrow key
    180 for left arrow key
    270 for down arrow key
    0 for right arrow key

    Or you could use the "Change Attribute" behavior.

    For the up arrow it would be:
    Change Attribute: (self.rotation) To: (90)
Sign In or Register to comment.