How to add multiple polygons as the body shape?

When setting up a custom collision shape for a sprite, there is an option to Add a collision mask. However I don’t see this option at the Physics2 behavior, I can only use a single convex polygon with a maximum of 8 vertices. This is a problem because then there is no easy way to create a collision mask for a concave object like this:
basket

What’s confusing is the relevant section of the documentation which suggest that you can add more than one polygon:

  • Polygon: A custom shape configured using vertices. This polygon must be convex (if this condition is not fulfilled, the shape falls back to a box). The number of vertices must be greater than or equal to 3 (otherwise, it can’t be convex) and less than or equal to 8 (the maximum number of vertices supported per polygon).

This is correct.

While collision masks on sprites can have multiple polygons, unfortunately collision masks in the physics2 behavior cannnot.

Is this something that will be added to GDevelop, or I should find an other solution?

As far as I know Box2D is what is used for the Physics Solution, and doesn’t support multiple polygons for a single physics body.

So I don’t think it is something that could be added directly to the engine itself.

1 Like