When i press left,right,up,down key it wont stop moving!

X-rayGamesX-rayGames Member Posts: 66
edited November -1 in Working with GS (Mac)
When i press left,right,up,down key it wont stop moving!

Comments

  • peachpellenpeachpellen Member Posts: 977
    How do you have your actor set up?
  • hrsmediahrsmedia Member Posts: 522
    If you are using change velocity then you have to put a stop velocity in the otherwise bit at the bottom of the rule.
  • X-rayGamesX-rayGames Member Posts: 66
    Down rule
    Actor receives event - [down] keyboard is down

    Change Velocity
    Direcion: 270
    Speed: 300
    Relative to: Actor
  • X-rayGamesX-rayGames Member Posts: 66
    oh ok
  • RHRH Member Posts: 1,079
    Watch out with the otherwise though, it could override or clash with other rules when using up,down,left and right to move. I tend to use change attribute to alter the linear velocities. Just a preference though.
  • expired_012expired_012 Member Posts: 1,802
    Try this:

    (note: don't use velocity, use the move behavior)

    Make an integer attribute called "move"

    Next go into the actor that you're moving. Here are the rules:

    Rule:

    When key(left/right/up/down) is down

    Change attribute (move) to 1

    Now make an otherwise in that same rule stating:

    Otherwise: change attribute (move) to 0

    2nd rule:

    When: attribute (move) is 1

    (now add a move behavior)

    Move actor to: whichever direction you want to move

    You will have to do this for all directions (up, down, right, and left
  • X-rayGamesX-rayGames Member Posts: 66
    Yay thx!!! artonskyblue again! lol :)
Sign In or Register to comment.