Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Help with moving and jumping

AkonronAkonron Posts: 11Member
edited November -1 in Working with GS (Mac)
Hello everyone

I am currently creating a game, but I need one of the actors to be able to jump.
I have managed to find out how to make the actor preform the jump, but if i want it to move left or right at the same time,
the actor stops in the middle of the air and starts moving to either side. as soon as i let go of the move-button,
it starts to fall again.

Does anyone know how to fix this problem?


  • Mr.pHMr.pH Posts: 26Member
    Well there are two things that you need to modify.....

    the first is that you need to add gravity to the scene. It is under the Scene Tab where you edit screen size and camera stuff(not sure how else to describe it.)

    The other is that you need to add density to the actor. That is under the physics option.

    Hope that helps
  • AkonronAkonron Posts: 11Member
    I have already created the jump instance, but if i try to move the
    actor left or right while jumping, the actor will stop falling until i stop moving left or right.
  • Mr.pHMr.pH Posts: 26Member
    Yeah.....I am doing something similar in my project and all that happens is that it slowly falls.....I think it is because it is staying suspended because it is being pushed left or right and not falling......but i am still trying to figure out how to fix this...
  • AkonronAkonron Posts: 11Member
    I figured that out, but i am having trouble fixing it too.

    Would be happy if you would tell if you come up with a solution.
  • KamazarKamazar Posts: 287Member
    *sigh* Before you ask any more questions, check out the sample project labeled "Platformer" when you open the app. Go to the main character's actor and the scene editor. Put it all together, and experiment. That way, you'll learn instead of carrying out an action you don't understand.
  • AkonronAkonron Posts: 11Member
    I am sorry i did not check the templates, thanks for the advise.
    But after I completed the jump, i now got a new problem, now the actor will keep on moving
    because of the acceleration-command. How can i stop him?
  • KamazarKamazar Posts: 287Member
    Set up a timer.

    If spacebar key is down
    Accelerate at 600 in direction 90 (move upwards)
    After 5 seconds
    Change velocity to 0 (keeps you from moving upwards. gravity will then take over)
  • quantumsheepquantumsheep Posts: 8,188Member
    That's a good solution Kamazar. I've personally set it up so that after a certain time (5 seconds in your case) I accelerate in a downwards direction at the same speed I went up ;)

    Dr. Sam Beckett never returned home...

This discussion has been closed.