Platforming Game Issue: Enemy Collision Problem?

  • So I have this weird issue on my platforming game. It's a very large project so I can't really provide a capx. I have several enemies in my game, but one enemy in particular is giving me issues. You jump on the enemy to damage it. The code for it is exactly the same as the other enemies.

    Here's a picture:

    https://www.dropbox.com/s/36zv2isvjjdpu ... n.png?dl=0

    Everything is normal until you kill him. For some reason, at the moment you kill him, you take damage, which doesn't make sense since it gets destroyed. I feel like this has happened once before, but I'm not sure how I fixed it.

    Any ideas? <img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question"> <img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question"> <img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question">

  • if you are using C2 250 try run the game in a different browser and see if the play still die.

    I had a problem like that the code was ok but in chrome it act strange then i change to edge it works then i close all broswer and C2 open back up and all working ok.

    But just double check your code if all still look ok try the above.

  • if you are using C2 250 try run the game in a different browser and see if the play still die.

    I had a problem like that the code was ok but in chrome it act strange then i change to edge it works then i close all broswer and C2 open back up and all working ok.

    But just double check your code if all still look ok try the above.

    Just tried that to no avail. If you come up with anything else, don't hesitate to shoot it at me. I'll keep trying things.

  • You can try adding another condition to event 806: Enemy Health>0

    If this doesn't help, add some debug output to event 801, for example Browser->Log "Collision:" & Enemy.UID

    This will tell you how many times the collision happens. It may be possible that when you apply vertical velocity, player collides with the enemy again, or maybe your enemy has some weirdly shaped collision polygon.

  • Yes check shape collision polygon

  • To aid assistance and avoid pointless guesswork, please consider providing the project as a single file. It is always the fastest way to a resolution.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To aid assistance and avoid pointless guesswork, please consider providing the project as a single file. It is always the fastest way to a resolution.

    I have actually made a small capx for problems I've had in the past, but this was the quickest thing I could do. My project is just getting too big.

  • You can try adding another condition to event 806: Enemy Health>0

    If this doesn't help, add some debug output to event 801, for example Browser->Log "Collision:" & Enemy.UID

    This will tell you how many times the collision happens. It may be possible that when you apply vertical velocity, player collides with the enemy again, or maybe your enemy has some weirdly shaped collision polygon.

    I tried this. Did not work. The hitbox is a normal square, so I think it is because of the vertical velocity being too fast. The enemy moves around in a circle, so when it is moving upward this is probably causing collision issues when the player is falling downward.

  • So does the collision happen twice?

    You can add something like a cool-off period. If there was a collision with enemy, ignore other collisions for the next 0.5 seconds or so.

    This is not the best solution, but without a capx there is nothing else I can do.

  • So does the collision happen twice?

    You can add something like a cool-off period. If there was a collision with enemy, ignore other collisions for the next 0.5 seconds or so.

    This is not the best solution, but without a capx there is nothing else I can do.

    I'm not sure if the collision happens twice. I could try to put together an exact replica of my situation in a capx.

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