Help with glitch where player falls through platform.

0 favourites
  • 13 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Ive come across an odd glitch in my game where my player goes through platforms for some reason.

    I had an issue with my autorunner where my player kept moving to the left when running off a platform, i managed to solve this by setting my players X position when they are falling (line 16). But after doing this, my player starts to go through platforms and i have no idea why.

    When i delete the event i created, the glitch doesn't happen, it works as it should. I don't know why it's doing this and would appriciate help on fixing this issue.

  • Why?

    As long as player is falling it's position will be set to x=138, so even if there are platforms there..

  • Because as i mentioned, i had a problem where my player moves to the left when they run off the platform. By setting the position, as i've done, it seem to solve that issue but now i have the glitch.

    You can try my capx and delete line 16 and you'll notice that my player moves to the left when running off the platform...

  • Anyone? I'm really stumped by this as i don't know why this is happening...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry to bump this but can anyone help? Can this be classed as a bug if it can't be fixed?

  • Hi tomhaiger, it's not a bug, it was actually because you set the x position of the player to always be at a certain point. The problem happens when you hit the side of the box. Instead of falling down, the X position is enforced, so it moves through the box since the condition to restart the level has not yet been met.

    I've edited your file a little with a little comment, so hopefully this helps.

    https://www.dropbox.com/s/17h639fi6mwc1 ... dited.capx

  • rekjl Thank you for your response, i've tried the capx but because the level restarts when the player overlaps the platform, it kind of renders the game unplayable as there is no way of telling when it could happen and it defeats the purpose of the game.

    I'm glad it's not a bug but could you help me find a workaround for this please? Could you perhaps fix it so that it worked as before but without the glitch and the player moving back to the left when falling (which i mention in the first post that i kind of fixed with Line 16)

  • No problem tomhaiger. I used a variable (I think I use variables a little too much for almost anything <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz"> ) to let the game know when I want to set the x position of the player. So once the player overlaps with the block, we use a variable to turn off the x position so that the player is free to fall. Also, I set another OR condition for the restart, where if the player's X position is under 0 (behind to the left outside the screen) it restarts as well.

    Here's the capx. Hope this helps.

    https://www.dropbox.com/s/8mtabn6w2qawd ... ited2.capx

  • You can never use too much variables

    Thanks but although it's a little better, I still get instances where the player skips through some platforms, and also when two platforms are close together that you can just run onto the other, if the platform you're running onto is just slightly raised than the one you're on and you run onto it (hope that made sense), either the game ends (restarts) or it skips through it.

  • Just reading through the forums, i was wondering using a invisible rectangle sprite with no animations with the Platform movement would work?

    I've read a few people that have recommened this for platform games, but would this work for an autorunner?

    If so, should i just create an invisible block and transfer all behaviours from the player to the block and replace the player with the block in the events?

  • Anyone with any advice of using invisible sprite?

    If this isn't the best way, could anyone else help me fix the glitch I'm having?

  • I do not know if that would solve the problem, but the rectangular invisible sprite is the way recommended by the manual

  • Unfortunately using an invisible sprite hasn't fixed the issue for me.

    Can anyone else please take a look at my capx and try and help fix the issue?

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