Complex collision shape in tile sources

Hi guys and gals! I’m building a small road game and have tiles for crossings and other road sections. It seems I can’t have a complex shape (like a t-crossing, for example) for the collision even when providing exact mask image with transparent pixels for the road. Am I right? No matter what I try, I see the collision bounding box around the whole tile, not just the three areas around the road. Is it the limitation of Defold?

Hello @spyromus ,

I experienced this one before, here my insights ;

Documentation says :

The editor will automatically generate a convex shape around each tile, taking into account pixels that are not 100% transparent:

Here is what is Convex wiki.

A post about this situation.

Here is how engine treated 2 different shapes with using shapes alpha.

** Concave Left , Convex right

Best Regards,

PS : if there is another info that i didn’t see yet, feel free to flag this post.

1 Like

Thanks for the details, mate. I don’t know but it looks like an easy to implement and super-powerful feature – custom polygon-based collision maps. Surprised it isn’t there. But anyway, I get the gist of it now, thanks.

I guess, I’ll be splitting my tiles in quarters to get to a single piece maps. If it doesn’t work, will start thinking further.

Cheers!

2 Likes