How do I end a jump if I hit a ceiling

0 favourites
  • 4 posts
From the Asset Store
Safaryx
$5 USD
The game ends when the player loses all their lives
  • So I've made a code with variable jump height using a couple of variables, and I've come across an issue which I feel like there should be an easy answer for - when I hit a ceiling my character keeps trying to move upwards, but it can't because there's a solid block in the way, and it ends up just hovering there before it starts falling naturally. So is there a way of starting a command with when the sprite hits a ceiling or the likes, so that I can set platform vector Y from there and make it start falling prematurely? Thanks in advance!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can add another condition - checking that your character is not overlapping the ceiling sprite.

    Use "Is overlapping" or "Is overlapping at offset" event and invert it.

    If this doesn't help, please post a screenshot of your events or capx file.

  • Since I'm using the platforming behaviour I had to make it so that it didn't apply for walls and make it on collision, but this did work, so thanks!

    Only problem is I'm also trying to use a wall climb mechanic where you can climb for a bit then you run out of 'stamina', like Shovel Knight Spectre of Torment if you've played that. So would it be possible to have my character overlapping with the wall but still make them stop climbing when they hit the ceiling?

  • Of course it's possible.

    Use a different object for the ceiling (not the same you use for walls) and check for overlapping or overlapping at offset with this object. If overlapping the ceiling- stop climbing.

    If your level is made of one tilemap, you can put an invisible sprite in areas where your character may hit the ceiling, and use it for overlapping checks.

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