For each enemy + many bullets + collision problems (+trigger once)

In my game, there are lots of enemies and lots of bullets or skills.
This is one of the events.

Because ‘for each’ + trigger once does not work properly, I’m using variable + timer instead.
This works fine when bullet is only 1 or deleted after hitting.

When there are a lot of bullets(skills), it does not work anymore.

So it is kinda hard to make a skill like this. (The bible in VS)
(Or multiple piercing bullets)

It is okay when bibles are rotating slow and there are few of them, but when it gets many and fast, it is very hard to find a right timer value between each collision.
And the timer value should be different for bigger sized enemy, so it makes it more complicated.

Can you give me some tips or solutions for this? Thank you!!

I tried
‘for each enemy’ + trigger once
‘for each enemy’ + trigger once + ‘for each bullet’
But none of them works.

1 Like

Silver-Streak , Greetings :blush:
I got the same question like the poster, and I tried adding some kind of variable to the enemies, like “CanBeHit” and make it a condition of the event that it is currently false, then set it to true once the hit occurs.
Then reset it to false when not in collision with the player’s Weapon.
it works when the amount of Weapon is 1, but when the player got more than one Weapon, the damage is applying by each frames.

1 Like

You could use the Health extension on the enemies, which has a built-in damage cooldown.

1 Like

Hi!! :blush:
Can it give skills separate cooldowns??
So that other skills can damage while the rotating one is still in cooldown.

may be we should design separate dmg cooldown timers for each kind of weapons, that’s the most stable way i think

1 Like

I just found that the skill cooldown is called hitboxdelay in VS, a file named “main.bundle” shows that the hitboxdelay is 0x6a4 which is 1700ms=1.7s in VS, it seems like it is a constant instead of variable.

here is the original code
[‘HOLYBOOK’],‘name’:‘King Bible’,
‘description’:‘Orbits around the character.’,
‘tips’:‘Best with: speed, duration, area.’,

1 Like

[How to Make a King Bible In Gdevelop 5 - YouTube]
I made a tutorial, hopefully it can help you

1 Like

How did you find a code of VS?!!! :eyes: :eyes:

And WOW thank you for the tutorial!!
I don’t understand the TimeDelta part yet so I gotta do some testing.

Thanks again and I subscribed! :wink:

open the file called main.bundle by windows built-in notepad or something
press Ctrl+F to search what u want
dont forget to copy a backup file at first

1 Like

Ah ha!!! Thank you so much !!! :pray: :+1: :+1: :+1: