# Rotate Actor relative to his walking direction.

Member Posts: 57

Hi!

I'm making a bird's eye view dungeon exploring game.
I know how to make my character move right, left, up and down but i don't know how
to make him pivot on himself to face the direction he's turning.
How can i make my character turn right on itself when i press the right key or left when press the left key...?

Thanks for all!
Really appreciated

• ImagineLabs.rocks Member, BASIC Posts: 5,666

Sounds like you'd just need to use a Rotate Behavior and have it rotate clockwise when you press right and counter-clockwise when you press left.

• Member Posts: 57

Actually it needs to move in all four directions, left, right, up and down. So when it goes in whichever directions it need to face that direction....

• ImagineLabs.rocks Member, BASIC Posts: 5,666

I'd have to see your rules and see exactly how you have your movement set up to help out more. Can you post a screen grab of your current movement rules?

• Member Posts: 57

Sure it's up, down, left, right upon pressing the arrow keys on keyboard.

• Member Posts: 57
edited July 2016

I made a copy paste mistake by pasting the "right" command twice on the picture....in reality it's down

• Sir doge Member Posts: 106
edited July 2016

Don't know if it's going to help but I used this rotation for my 2d character.
If game.boolean = true
interpolate self.rotation to self.angle (-360 or + 360) depending on which way

And you need to set the button or rules which fires off the game.boolean

• Member Posts: 57

Ok guys got the solution, thanks for your help!

• ImagineLabs.rocks Member, BASIC Posts: 5,666

Just got back from lunch, glad you got it worked out.

• London, UK.Member Posts: 12,822

@jamie_c said:
Just got back from lunch, glad you got it worked out.

Glad you got back from lunch.

• ImagineLabs.rocks Member, BASIC Posts: 5,666