How to make a player jump

ChucklingMonkeyChucklingMonkey Member Posts: 92
edited November -1 in Working with GS (Mac)
Hi, I looked at the platform example for this but it was to confusing. So, how to you make your player properly jump. I tried making rule saying when key right is down, move up. Then I added the gravity to 1500. The problems are that there is no jumping limit so you can fly and when you jump on a surface and jump off you fall.

Thanks

Comments

  • liamoliamo Member Posts: 191
    I think it was something like change velocity to so and so, I'm not in front of my computer screen at the moment, it's change something...
    :s
  • svnsvn Member Posts: 445
    Wait, what? ChucklingMonkey, I didn't quite understand your query.
  • ChucklingMonkeyChucklingMonkey Member Posts: 92
    svn said:
    Wait, what? ChucklingMonkey, I didn't quite understand your query.

    Sorry :D I said that tried to make my player jump I make a rule saying when up key is down move up. Then I added some gravity to the level. The player jumps but there are a few problems. First, when you hold the up key you can fly( which I don't want). And, second when the player hits and wall to jump over he'll flip over and not able to get up.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Sounds like you need to click "fixed rotation" under the actors physics, and set an attribute to determine if the actor is grounded or in the air, and for discussion purposes, lets call that attribute "grounded". So then your jump controls would go something like this…

    Actor receives event > key "right arrow" is down (click the plus sign to add another condition) Attribute > self.grounded > is true (click the plus sign to add yet another condition) Attribute > self.Motion.Linear Velocity Y = 0
    Change Attribute > self.Motion.Linear Velocity Y - To:self.Motion.Linear Velocity.Y +400 (change that 400 number to a number that suits your needs)

    I can't tell if you added gravity to the whole scene, or just put an acceleration on the actor, but Instead of gravity being on the entire scene, you could just add a downward acceleration to the actor of about 1500. If that's what you did, then disregard.
Sign In or Register to comment.