GameSalad

Double Jump issue: Lack of gravity when holding spacebar!!!

After I looked through a few tutorials on double jumping I was able to get it to work right away. However, I noticed something that's been bothering me when I was testing this in preview. Everytime I hold the spacebar one time the player jumps and keeps flying in the air instead of gravity pulling it down. But then whenever I press the spacebar twice for a double jump and hold it, it falls back down to the ground correctly which works fine. What's really weird is that I literally did everything correct and I even downloaded another project that contained the same rules I applied to my project and it works fine on that one after testing it, but in my project it's always a problem. I have used "Accelerate" to direction 270 which is down and gravity only works when I press the spacebar twice and hold it after I double jump but it doesn't work when I jump just once while holding spacebar. If I tap the spacebar once it falls back down but holding it for a long period of time makes it fly up and doesn't fall back down until I release it.

Here is what I've done so far:
https://drive.google.com/open?id=0B-lJpxbDBNVoczE2RGNZVF9YeEE
https://drive.google.com/open?id=0B-lJpxbDBNVoSTdiY0l2eTdYbHM
https://drive.google.com/open?id=0B-lJpxbDBNVobENrNFQ3bkNUS1E

This is the project I copied the rules from:
http://www.jamie-cross.net/?portfolio=gamesalad-recipe-006-platformer-powerups-double-jump-shield-shrink-and-hidden-block-mario-style#.WJ6vC1UrLIU

Here is a quick sample of the issue:

Comments

  • SocksSocks London, UK.Posts: 12,221Member, BASIC
    edited February 11

    In the 'Jumping' rule, change . . . .

    Constrain attribute linear velocity to 620

    . . . To . . .

    Change attribute linear velocity to 620

  • Chestosneako+IncChestosneako Inc Posts: 25Member

    @Socks said:
    In the 'Jumping' rule, change . . . .

    Constrain attribute linear velocity to 620

    . . . To . . .

    Change attribute linear velocity to 620

    Bro that TOTALLY WORKS!! I can't believe it only took me one answer to solve this!! I really gotta start learning the differences between Constrain and change attributes, that's the only thing I needed to change to fix this. Thanks man!!

  • pHghostpHghost London, UKPosts: 1,755Member

    Constrain basically means change on every frame, so on every frame your actor's LV got set to 620, overriding the gravity.

    Change attribute changes it only once (per activation) and then other stuff can have an effect.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,826Member

    @Chestosneako Inc said:

    @Socks said:
    In the 'Jumping' rule, change . . . .

    Constrain attribute linear velocity to 620

    . . . To . . .

    Change attribute linear velocity to 620

    Bro that TOTALLY WORKS!! I can't believe it only took me one answer to solve this!! I really gotta start learning the differences between Constrain and change attributes, that's the only thing I needed to change to fix this. Thanks man!!

    See my video series on the physics engine and my gslogic series.

Sign In or Register to comment.