Rotate Actor relative to his walking direction.

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

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    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.

  • AlphaCentoriAlphaCentori 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....

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    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?

  • AlphaCentoriAlphaCentori Member Posts: 57

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

  • AlphaCentoriAlphaCentori 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

  • ohtukrwohtukrw 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

  • AlphaCentoriAlphaCentori Member Posts: 57

    Ok guys got the solution, thanks for your help!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

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

  • SocksSocks 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.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @socks lol, thanks.

Sign In or Register to comment.