Family with possible simultaneous collisions unreliable?

  • Hello! I'm working on a multiplayer platform fighter kind of game, and I'm using a family for the attacks and player characters.

    Mostly this has worked fine. But sometimes i've run into some issues when 2 collisions happen very close in time to each other. Right now this is what I've stumbled into. This is my respawn system for the player characters.

    My attacks simply deal damage to the players upon collision. One of the attacks is a plain square sprite "punch" that appears instantly while the other is a bullet. The problem happens with the bullet: if both player 1 and player 2 shoot it towards each other when the bullet is enough to put their health to 0 and one dies just before the other one gets hit too, the second one does count as "dead" as I verified but they don't get moved outside the layout and respawned. They just stay there and hitting them starts giving them negative hp.

    Now, this problem DOES get solved if I make the same mechanism for both player characters separately, so it's not a huge problem. But I want to know why it doesn't work just with the family, so I won't run into similar issues in the future.


  • Aldenwar

    just guessing here, but you may need a "For Each PlayersCharacters" under the 4th event. That code might be failing if two players are dead at the same time. The Trigger Once may also be part of the trouble.

    I would try to eliminate the trigger once by expanding the player's status to Alive / Dead / Respawning

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It ended up being kind of more complex than having the players handled separately but removing the trigger once while true and adding more states did fix the issue! I suppose I'll have to be more mindful about using trigger once in the future, which is a shame considering how handy it is.

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