Composite Collider 2D stops being created after a certain distance from center of Tile Map

Tiles with Tilemap Collider 2D collision shapes stop working with the Tile Map’s Composite Collider 2D once placed a certain distance from the Tile Map object’s center. Once “Used by Composite” is unchecked, however, their individual collision shapes continue to work. In my project using a pixels to units setting of 16, this starts happening about 214 units in every x/y direction from the center.

It is unclear to me whether this behavior is intended or known, but I see nothing in the documentation suggesting otherwise.

If this behavior is intended or must exist, we should be able to know exactly how large our individual tilemaps can go before breaking the Composite Collider 2D system. This way, we will easily be able to combine Tile Maps for larger worlds. Please correct me if I’m wrong, but at this point, the Tile Map’s grid makes it seem like it is an “infinitely” large tilemap, with no bounding gizmo suggesting otherwise.

Just tested it - seems like there is a bug here. Thanks for catching that.

I’ll take a look but it would help if you could provide an reproduction case. What do you mean by units? Could you give me an idea of world size your’re talking about? Have you tried colliding with things that don’t appear as it might be a problem with the gizmo drawing rather than there not actually being a collider shape there.

It would be good to get a project but if you could at least describe the composite setting and world sizes you’re referring to it would help reproduce it.

By “units,” I mean the transform position increments in space. Meaning at -214 x to 214 x and -214 y to 214 y. The collision does not work beyond these points; it’s not just the visibility of the collision shapes. When “used by composite” is unchecked, however, both the collision shapes are drawn and the collision works.

2876346–210947–Test Project.7z (2.13 MB)

That is extremely odd indeed. Thanks for the project, I’ll give it a test.

So I’ve been digging through this all evening but I’ve finally tracked down the issue. It’s due to a bad cast internally. I’ll get a fix and see if it’s possible to get a new preview#3 release patch or something. I’ll keep you updated.

BTW: I wanted to add that I really appreciate you finding this; I’ve seen a similar issue before but only once and it troubled me that I couldn’t track it down.

1 Like

This is good to know, thanks!

I wasn’t actually making a large map when I found this. My scene’s action was not at the origin (due to the canvas being at the origin and getting in the way) and this is why I found it.

Also, I’m not sure if you noticed: drawing colliders past +214y (at the top part) while composite is checked creates a long collider shape that stretches all the way down. Not sure if this is related.

Yes, the problem affects both axis. I’ve asked internally and it might be possible to get an updated release next week.