Collision Issues. How to fix?

0 favourites
  • I have an event for each enemy that is basically as follows:

    Player on collision with Enemy

    ----------Player Y < Enemy ------------------------------- Subtract 1 from Enemy Health

    Else

    ----------Player is not flashing -------------------------- Flash

    ------------------------------------------------------------------- Subtract 1 from Player Health

    I've been having this weird issue where, when the player jumps on an enemy, most of the time it works exactly like it's supposed to, but sometimes it doesn't and the player just falls right through the enemy and takes damage. I've tried to fix it myself, and every time I think I've fixed it, it comes up again. any ideas?

    Any help is greatly appreciated.

  • Are the collision setting correct?

  • Are the collision setting correct?

    If you mean collisions are enabled, yes they are. I could set five enemies down, jump on four of them with no problem, but fall right through the fifth one.

  • Post a CAPX for help.

  • I wouldn't be sure then! Good luck and i hope you find an answer shortly!

  • Post a CAPX for help.

    Here's a capx. Jump on the enemies and you'll see the problem.

    https://www.dropbox.com/s/qf664c0oe083t ... .capx?dl=0

  • Aquanex2

    it looks like your collision box for the enemies are quite small to use in combination with the Shine behavior so the player misses the collision with the enemies when is falling, My guess is because the enemies move up to fast because of the shine behavior and swell on collision with the player they keep still moving up there is no push back for them, so because the player is falling fast too that's why it misses the collision some times.

    you can either change the enemies collision box to their full box or make the enemies solid

    both of this options worked for me without a problem

  • Aquanex2

    it looks like your collision box for the enemies are quite small to use in combination with the Shine behavior so the player misses the collision with the enemies when is falling, My guess is because the enemies move up to fast because of the shine behavior and swell on collision with the player they keep still moving up there is no push back for them, so because the player is falling fast too that's why it misses the collision some times.

    you can either change the enemies collision box to their full box or make the enemies solid

    both of this options worked for me without a problem

    It can still happen even if I turn off the sine behaviour as well, although it is far more infrequent.

  • Aquanex2

    Is working ok for me here, if I add the solid behavior to the enemies and with the shine active, it didn't happen not even once, and in another test, I left it for more than 10 minutes jumping and is still jumping while I'm writing this I'm not sure what it could be in your case.

  • Aquanex2

    Is working ok for me here, if I add the solid behavior to the enemies and with the shine active, it didn't happen not even once, and in another test, I left it for more than 10 minutes jumping and is still jumping while I'm writing this I'm not sure what it could be in your case.

    Okay, I added solid and now it's working fine, but what if I don't want the enemy to have a solid behaviour?

  • Aquanex2

    That's why I gave you two option that worked for me in my first post, so you can choose the one that it suits you more lol

    The second option was, make the enemies (collision box) to the size of their full shape box and with this option you don't need the solid behaivor, at least for me is working, try it and see how it goes in your side

  • Aquanex2

    That's why I gave you two option that worked for me in my first post, so you can choose the one that it suits you more lol

    The second option was, make the enemies (collision box) to the size of their full shape box and with this option you don't need the solid behaivor, at least for me is working, try it and see how it goes in your side

    It works. But in my actual game, I have many different enemies with different collision boxes. I wanted the collision box to accurately reflect the enemy, so that you know you hit it when you hit it. If this is the only fix. I'll just have to adjust the boxes. Thanks for the help.

  • Aquanex2

    I see what you mean now

    See if this one can help you, works with the collision box you like and without the solid behavior like you wanna. That is the only thing I can think today, maybe some else can find a better Idea

    Capx:

    https://www.dropbox.com/s/679sgoivdvste5i/Weird%20Collisions2.capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aquanex2

    I see what you mean now

    See if this one can help you, works with the collision box you like and without the solid behavior like you wanna. That is the only thing I can think today, maybe some else can find a better Idea

    Capx:

    https://www.dropbox.com/s/679sgoivdvste5i/Weird%20Collisions2.capx?dl=0

    I just got off work and took a look at this. What a great idea! it'll take a while to change all of my events in my game, but it'll be worth it. I'll do this soon! Thanks!

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