Jump Control Problem

studiocritystudiocrity Member Posts: 14
edited November -1 in Working with GS (Mac)
Slight problem:
I have a transparent, non-scrollable layer over my scene that has the behaviour:
When touch is pressed change attribute game.JumpControl to true
The actor that jumps has the behaviour:
when game.JupControl is true accelerate upwards then change attribute game.JumpControl to false

This works perfectly for the first click or touch, though when i try to jump again nothing happens, though the rest of the game and other controls work fine.
Hope somebody can help, thanks

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Do this. In your transparent actor have:

    when touch is pressed
    -change attribute jumpControl to true
    --then open up the otherwise section of that rule and have a change atttribute behavrios changing jumpControl to false

    Then in the actor that has the jump have this:

    When attribute jumpControl is true
    -change attribute self motion linear velocity to 350

    Then have an accelerate down behavior relative to scene to act as gravity

    Cheers
  • studiocritystudiocrity Member Posts: 14
    thanks for the suggestion but i still have the same problem
    I already have scene based gravity and a 'determine if grounded' control so the character can only jump while on the ground
    Also i can jump twice not once :S
Sign In or Register to comment.