Actor moves diagonally when i press two movement buttons at the same time for movement

Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168
edited March 2015 in Working with GS (Mac)

Hello, I have an actor, that can move up, down, left and right. When i press, lets say up and right together it moves diagonally, or when i press the up and right, one after another really quickly, it moves diagonally.

So my question is what would i have to do, so it doesn't move diagonally?

Thankyou.

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @Thor said:
    Hello, I have an actor, that can move up, down, left and right. When i press, lets say up and right together it moves diagonally, or when i press the up and right, one after another really quickly, it moves diagonally.

    Thankyou.

    Do you have a question ?

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @Socks said:
    Do you have a question ?

    Yes what would i have to do, so it doesn't move diagonally?

  • mhedgesmhedges Raised on VCS Member Posts: 634
    edited March 2015

    I've had this happen to me before. You either separate the buttons on the screen so a two-axis movement does not occur, or you write a boolean to lock out the "other" movements while your intended movement is executed.

  • MantoManto Member Posts: 796

    Put the rules inside the otherwise sections of other rules.

    For example:
    Rule if key up pressed
    -Move up
    Otherwise
    -Rule if key right pressed
    --Move right
    -Otherwise
    --Rule if key down pressed
    ---Move down
    --Otherwise
    ... Etc.

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @Manto said:
    Put the rules inside the otherwise sections of other rules.

    For example:
    Rule if key up pressed
    -Move up
    Otherwise
    -Rule if key right pressed
    --Move right
    -Otherwise
    --Rule if key down pressed
    ---Move down
    --Otherwise
    ... Etc.

    @mhedges said:
    I've had this happen to me before. You either separate the buttons on the screen so a two-axis movement does not occur, or you write a boolean to lock out the "other" movements while your intended movement is executed.

    Ok thankyou.

Sign In or Register to comment.