Issues with UIDs in functions?

  • Honestly, I'm not really sure what my issue is here. I've been trying to compartmentalize my game's damage and hit calculation in functions, since I initially built them before the new functions debuted, but I'm having lots of issues.

    Right now, if you kill a second enemy before another one dies, it breaks the entire hit collision of the game. Killing single enemies works, killing multiple enemies at the same time works, its just killing one then immediately another that not only messes up that enemy, but breaks hit detection for every other enemy in the game as well.

    Here's a link to the file. I'm new to using C3's new functions and calling via UIDs, so I'm sure I'm missing something obvious. But I've rebuilt the system four times now with no luck.

    dropbox.com/s/czh4fypus82fz0n/azumi_fullgame4.c3p

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I believe the problem is in "Enemy State Dead" group. Trigger Once condition doesn't work per instance. And you shouldn't place it as a sub-event. And "On any animation ended" also shouldn't be there..

    Try changing the code like this:

    It's still not ideal, because event 16 is checked on every tick, and if you have lots of events like this, it's bad for performance. So I suggest moving all actions into the function (if HP<=0, then disable collisions, start dead animation etc.)

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