Handle multiple collision masks independently

In my opinion, we should treat multiple collision masks of a sprite independently, imagine if you could do something like give a name to each individual mask and use a new condition to check if the collision occurred with that specific collision mask, instead of using many useless sprites just to act as several collision masks?

Note, there would be 2 different collision conditions, one to check if the collision has occurred in all masks (the current one), and another to check if a specific collision mask has collided another object.

18 Likes

I thought about this these days when I was trying to float an ice cube in my game! The collision mask that served at one point in the code was not appropriate for another moment and I had to create a new object to serve as the second collision mask.

I liked this solution. It doesn’t break the old games. :+1:

3 Likes

I would like to see this get added

1 Like

To add to this, It would be nice if we can make certain collision boxes “Non-Collideable” if we need them for hitbox detection without causing the “Teleport through Object” bug lol.

2 Likes

this is my main issue with GDevelop I would absolutely love to see this feature.

2 Likes

to add to this you could call to them by saying something like, obj_name.collision_mask for is you were trying to change a variable with the mask outside of collisions.
this would also be helpful with for example attacking because you could make a swinging sword animation for a player and then make a mask over the sword and only have that be the collision.

2 Likes

I’m going to link this in my request, cause it could be used to create many diferent systems of custom collison masks

2 Likes

This feature would be incredibly useful; I recently had an issue that I could have solved immediately with it!

3 Likes

Adding my vote to this as well. Since we can add multiple hitbox masks on an object I was with the idea that we can already do this.

2 Likes