how do i make my player only jump if its on the ground

THINGTHINGTHINGTHING Member Posts: 84
edited November -1 in Working with GS (Mac)
how do i make my player only jump if its on the ground

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    You SHOULD be able to just check if your player is on the ground but GS does not have perfect collision detection (trust me I've been pulling my hair out over it!) so you need to use a workaround.

    Here's what I do. Create a boolean game attribute called game.jump and a second boolean called game.touchingGround.

    Create a button actor with the rule:
    When touched is pressed
    -----change game.jump to true (1)
    OTHERWISE
    -----change game.jump to false (0)

    In the jumping actor
    Rule
    When collides/overlaps with ground
    change game.TouchingGround to true (1)
    OTHERWISE
    change game.touchingGround to false (0)

    Second Rule:

    When game.TouchingGround is true
    ------Rule - when game.jump is true
    ----------Timer for .8 seconds (do NOT check the run to completion)
    --------------accelerate 90 to scene speed of 800
  • FranzKellerFranzKeller Member Posts: 517
    What does the run to completion do or not do?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    run to completion will make the actor jump the same height every time no matter how long you hold down your jump button. Unchecked means that if a person touches for .1 seconds the actor will jump a little bit and if the person touches for say .5 seconds the actor will jump higher.
  • realmadrid1012realmadrid1012 Member Posts: 37
    What games did you say
    rs gold
    runescape accounts
  • quantumsheepquantumsheep Member Posts: 8,188
    realmadrid1012 said:
    What games did you say
    [spam deleted]

    I'm going to enjoy watching you get banned! :D

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • realmadrid1012realmadrid1012 Member Posts: 37
    quantumsheep said:
    I'm going to enjoy watching you get banned! :D

    QS :D

    Why?I do something wrong ?
Sign In or Register to comment.