Resuming a key-press?

bladeolsonbladeolson Member Posts: 295
edited November -1 in Working with GS (Mac)
I have a game in which my character jumps and then i made it so when he lands an animation is triggered having him "land" and sets the velocity to 0. I am finding it feels natural that someone would be holding down the left or right controls on landing and the assumption is that the character would resume walking to the left or right after the jump.

Does anyone know how I can "resume" the key that is being held down. Right now , the user needs to let go then re-press the left or right control to keep moving. This works, but feels unnatural.

blade

Comments

  • BeyondtheTechBeyondtheTech Member Posts: 809
    I would simply store the last horizontal direction press in a separate Attribute, so that when he lands, you can "restore" the direction immediately afterwards.
  • bladeolsonbladeolson Member Posts: 295
    Thanks. That helped. It seems to work now.

    new issue now. If I let go of the direction key just as he lands, he keeps walking to left or gith. then if I jump again he still keeps walking even if no L or R keys are held down.
  • bladeolsonbladeolson Member Posts: 295
    I think I got it BeyondTheTech. I had been putting the "storeLastKePressed" in the landing rule, but I changed it to go inside with the key presses and now it works. Thanks for your help!

    blade
Sign In or Register to comment.