Howdy, Stranger!

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

Disable movement during jump?

ArtesupremeArtesupreme Posts: 1Member
edited November -1 in Working with GS (Mac)
I have an actor / player that can move left and right and jump. However, is it possible to disable the left & right movement rules while the actor is jumping? Any suggestions how to do so?


  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    Set an attribute that signifies when you are jumping. In your rules that check if you are pressing the keys that enable you to run the behaviors that move you left and right, add the condition to check if the attribute signifying that you are jumping is false.
  • bladeolsonbladeolson Posts: 295Member
    I am trying to implement something similar to this. My character jumps and moves left and right. It feels unatural when for example he is running to the right then jumps, then in mid air you hit LEFT and he magically jumps to the left.

    If I disable movement left and right while jumping, won't that make my character only able to jump up and down and not get a nice arcing jump?

  • scitunesscitunes Posts: 4,047Member, Sous Chef
    you should be fine if you use accelerate. the other ones will likely be more unnatural.

    may want to also set the max speed to keep from accelerating out of control
  • JamesZeppelinJamesZeppelin Posts: 1,927Member
    I was able to get a pretty smooth jump with a timer that moved up really fast for only about .8 seconds then after used a small amount of move down.

    It stayed smooth and the move down got rid of that "floaty" feeling

    The problem i find is that the amount of move up to break gravity just doesn't feel right coming back down with gravity alone. So if you add more gravity it just makes you go up less and your back where you started. the move down really helped.

    Ill upload a demo soon. Kind of unorthodox but i think it ended up feeling pretty nice
  • scitunesscitunes Posts: 4,047Member, Sous Chef
    sounds interesting!
  • bladeolsonbladeolson Posts: 295Member
    James, I would love to see that demo. I am really trying to get something that feels right , seems key to me for any game with jumping
  • POLYGAMePOLYGAMe Posts: 3,470Member
    Did anyone have any luck with this? Seems like it should be a simple thing to do but I can't find any answers.
This discussion has been closed.