Hitting all enemies in a sprite's collision mask

So I’ve been working on this top-down game and I’d like to have some large attacks in the game to sweep and hit a cluster of enemies, however, even though the collision masks for the beam attack sprite are overlapping the enemies it doesn’t seem to register every instance of enemy in the zone

I’ve tried using “every instance of” as well as not, ive noticed it with some of my smaller attacks too, shooting a lone sprite works fine but in groups it gets funky

Gif of it in action
The smoke effect and damage numbers indicate which sprite was hit

Recording

its not a case of the dmg numbers and effect not showing, they’ll usually die one by one if i keep the attack on them

I believe you should put the “repeat for each instance of Enemies” at the top in the collision condition.

yea I tried that at first and it ended up making no difference

Can you show the rest or the main events for this action?
Also are you trying to create the fire effect at the centre of each skeleton?
Personally I always use Enemies.CenterX() + Enemies.CenterY()
Bounding box just never seem to work as I expect it to.

No, collision first, then repeat for each. You reduce the number of objects to iterate over as much as possible, because the repeat events do take up processing time.


Why do you have the repeat every 0.2 seconds on there? It may not be doing what you want it to.


here’s all the events for the attack

i put the .2 repeat so that while an enemy is inside it ticks the damage applied at that interval instead of every frame. unfortunately, even without it it still only targets a 1 or two and ignores the rest

Recording3

I also made the scenario again with a new test sprite with no other behaviors besides health, incase there’s something weird with the skeleton sprites, but stull seems to cause the same issue

sorry for the replies new user so i cant post mutliple embeds in one reply, this is for the last reply gif

Recording4

No idea why it didnt before but i tried again without the repeat every .2 and it all works! thanks a bunch
how would you go about limiting the hitting ticks on each enemy?

Put an object timer on each enemy at the start of the game.

When you check for collision between beam and enemy, also check that the enemy’s timer is greater than 0.2.

In the actions that inflict the damage, reset the object timer.

Recording5
Yup works perfectly thanks a lot!!

Side note, you have an action to apply force to “skellie_01”, it should be apply force to “Enemies”