Multiple Jump Problem

FatalCrestFatalCrest Member Posts: 113
edited November -1 in Working with GS (Mac)
I'm having little trouble stopping my actor from doing multiple jumps, is there a way to prevent more than 1 jump?

*My actor responds to a button that tells him to jump if touched*

- Integers -
jumpTrigger (0 for off, 1 for on)
jumpAmount

when JumpButtonActor is touched, jumpTrigger = 1
when jumpTrigger = 1 my actor jumps then adds 1 to my jumpAmount int
when jumpAmount =1 i want my button to not respond to any touches until he lands

I need a little help!

Comments

  • AfterBurnettAfterBurnett Member Posts: 3,474
    You could set up an OnGround attribute and only have him jump when OnGround is set to true. For example, have a rule that states when actor collides with actor (ground), set OnGround to True, otherwise set to False. Or words to that effect... I'm a noob myself.
  • AfterBurnettAfterBurnett Member Posts: 3,474
    Actually, even simpler way... as well as the "when key is pressed" add AND actor overlaps/collides with actor (ground) MOVE (or whatever manipulation tool you are using). This way it will only jump if on the ground.
  • FatalCrestFatalCrest Member Posts: 113
    Perfect! Thank you POLYGAMe! It's working great! :3
  • AfterBurnettAfterBurnett Member Posts: 3,474
    I aim to please... or as my girlfriend says, "please do aim... I'm sick and tired of mopping up after you".
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    If you are on the side of a platform you can still jump. The safest bet is to only jump when vert velocity is zero
  • AfterBurnettAfterBurnett Member Posts: 3,474
    Hmmm, good point.
Sign In or Register to comment.