Why codes one bullet hit multiple enemies?

pjnolenpjnolen Member Posts: 152
edited November -1 in Working with GS (Mac)
Supposed to read 'Why does one bullet hit multiple enemies?'

My player shoots a bullet but if 2 enemies are close enough they both get hit. If they are overlapping even just a little bit.

I could see it, if the bullet happen to hit them both when both the badguy actors were perfectly overlapped and were the same pixel distance away from the player so the bullet actually did reach them both. But it seems they can be a few pixels apart and still both get hit.

If I could get them to work well on the screen with collision on and not go all wonky and freakout when they hit each other that would be ok. But they sometimes teleport into the center of the player if one runs into the other.

Anyone have any suggestions?

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Are the actors onscreen made from the same prototype actor in the library? If they are, you need to create multiple prototypes so they have their own identity, or else when one gets hit, any other instance is registered as being hit as well.
  • pjnolenpjnolen Member Posts: 152
    Yes, they are all the same badguy. If they're at least half a length away, only the closest one takes damage. For testing I have their hitpoints displayed. It's just when they get a little closer than halfway is when they start sharing damage. I would have expected the one who's pixel was first to hit the bullet would have taken the damage, but it seems to be a wider range than 1 pixel.

    If I just had a way of having the badguys 'chase' the goodguy without fricking runing into each other that would be great.

    As stands now I have them set to follow the player's x&y every 3 seconds but no matter where the badguys start on the screen they end up in 1 pile. The way I got around that was to randomize their movement speed towards the player's x&y. Which can help separate them. But it seems the only way to REALLY separate them is have them move to the player's x&y at different TIMES. You can't do that if they're the same actor.

    Sometimes these little things really are a frustration when you don't have enough experience with GS.
Sign In or Register to comment.