toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
When i press left,right,up,down key it wont stop moving!
X-rayGames
Member
Posts:
66
August 2010
edited November -1
in
Working with GS (Mac)
When i press left,right,up,down key it wont stop moving!
Comments
peachpellen
Member
Posts:
977
August 2010
How do you have your actor set up?
hrsmedia
Member
Posts:
522
August 2010
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-rayGames
Member
Posts:
66
August 2010
Down rule
Actor receives event - [down] keyboard is down
Change Velocity
Direcion: 270
Speed: 300
Relative to: Actor
X-rayGames
Member
Posts:
66
August 2010
oh ok
RH
Member
Posts:
1,079
August 2010
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_012
Member
Posts:
1,802
August 2010
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-rayGames
Member
Posts:
66
August 2010
Yay thx!!! artonskyblue again! lol
Sign In
or
Register
to comment.
Comments
Actor receives event - [down] keyboard is down
Change Velocity
Direcion: 270
Speed: 300
Relative to: Actor
(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