Preventing Direction Change in Mid-Air

0 favourites
  • 6 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • Hey, there.

    I spent a good hour and a half trying to find a way to prevent a character from changing direction in mid-air after pressing the jump key. None of the things I tried were remotely successful, and I couldn't find anything to really help me in any tutorial or the manual.

    If someone has solved this problem or has an idea of how to go about doing it, I would love to hear it.

    Thanks so much in advance, guys/gals.

  • You can use "is on floor" event. Invert it and it becomes "is in midair". With this event attached to your input event, that should do the trick.

    Does that solve your problem?

  • That solves the first half of the problem; targeting the character when it's off the ground, but I still don't know what to do to keep it moving forward at the pace it was going at when it left the ground.

    Since it doesn't stop additional input, I'm afraid it doesn't solve my problem.

  • How about creating a global variable and when the player jump, you store the value of vector x of the player in this global variable? And then when the player is NOT on floor, always set vector x to the value stored in the aforementioned global variable?

  • Hey, that could work. I'll give it a shot here shortly and I'll see how it works. Thanks for your help so far, man!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • And one more thing, you can change the deceleration value of the platform behavior.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)