I urgently need help. I have an enemy spawner that spawns three enemies with a health bar. So far, everything’s fine, but if only one enemy takes damage, three enemies get deducted from everything, but only one health bar should take damage, not all three at the same time. What exactly do I need to change? Trigger Once doesn’t work either:/
Object linking is one way
You check if enemy have linked to itself healtbar if not you create one and link it to it
Thanks for the quick reply. I did it like you did, but the error wasn’t fixed. I use a timer that spawns three enemies every five seconds. Could that be the reason?
Maybe I expressed myself incorrectly. I’ll explain it better. I have a timer that spawns three enemies every five seconds. All three enemies have healthbar. Up until then, everything works great, except when one enemy takes damage, they all die, but only one should die. Could it be that I need to change something in the timer?
I wanna see screenshot of your events
Cause i am pretty sure they don’t look like mine
You could spawn 100 enemies each second and my events would still work so it have nothing to do how much you spawn and how often
Can you screen shot the events that inflict damage to the enemy?
That is nothing like my screenshot
You aren’t selecting which CopperRedBar2 to decrease the value for, so GDevelop will be doing all of them.
Doing a Repeat and collision check condition is less efficient that doing a collision check first and then doing the repeat.
So I’d suggest you modify the events slightly:
- First Get rid of the trigger once in that event, it doesn’t work the way you think it does in a repeat.
- Second, use a normal event that checks for enemy collision with a bullet and have the “
Repeat for each instance of Enemy
” as a subevent off that. In that subevent add a “Take into account RedCopperBar2 linked to Enemy
” condition.
I’ve tried that now too, unfortunately without success. I’ve also tried several things with it myself, but every time they all get damaged at the same time. Hmm.
What is that repeat doing? Nothing - you have no actions in it.
And in the first event you’re still changing the CopperRedBar2 without specifying which one. Move the actions from the first event into the repeat event.
I’m so stupid…
thank you very much , it finally worked!!