Multiple enemy collision mask issue

hi guys, as far as you know, are there any problems with collision masks?
I have melee weapons with dynamic masks that change with each animation.
what happens is that if the enemies are close to each other and are hit, enemies that theoretically shouldn’t be hit are also taken into consideration.
I imagine that the collision mask is not taken into account in the selected frames or that the grouped enemies collide create a sort of row and that the damage also reaches the enemy that should not be taken into account by the hit.
I tried to completely eliminate the collision mask by setting it all to 0 and leaving it active only in frames 6-7 but I get an error at the beginning of the scene blocking the game.
this is my event:


this is the attack frame mask (6-7)

while for the rest I left the default collision mask

instead of creating the hit with the collision mask why don’t you try to create an object called HitBox or something similar to a custom point of this object in the conditions you already have? all you need is a trigger once for the creation of the object and if I’m not mistaken a sub event for its elimination, so the object is created and in an instant it is eliminated, and it is that object that will touch the enemies, so I did in my Sword Platformer.

(Comunque dagli eventi sembri Italiano o mi sbaglio?)

1 Like

Is danni an object group that contains arma15? Otherwise, why are you checking for collision with danni when it should be arma15?

Also, I’d structure this event differently:

Put those 4 conditions in a standard event and have the Repeat for each nemici as a subevent off that. It’s more efficient and could solve the issue.

1 Like

If I recall correctly, if you have a trigger once in a repeat, it only runs once for the all the repeat loops.

yes, but I didn’t mean to put a trigger once in his events, but to completely change the events to the ones I suggested. Because i had the same issue one year ago and i fixed in that way. That’s the screen of how i managed it

1 Like

Thanks for sharing the screen shot - it’ll give @ilary27 a help on what you mean. Sometimes we need to many words and sentences to describe what can be done easily with an image.

Note that the trigger once is not required in that first event, because the animation is changed to “Attack”, so not all the conditions will be met in the next game frame. And it’s not necessary on the second event either - the set boolean action is probably quicker than the check whether the event has been previously triggered.

2 Likes

hi @Kruger yes I’m Italian I had already tried in the past to create a hitbox to manage the damage but I think the collision mask is more precise.
the strange thing is that previously everything worked correctly.
@MrMen yes “damage” is a group containing several damage objects
here is a complete screen of the code

I ended up having to follow @Kruger 's suggestion by using a hitbox.
collision using mask doesn’t work as expected
thank you so much guys

1 Like