Optimizing generated Meshes and PolygonColliders in a 2.5D side-scroller game

Hello,
I am making a 2.5D racing game, kinda like Hill Climb Racing or MMX Hill Dash.
For the road I made a system that uses curves. The curves are used to make the PolygonCollider2D, and the curve is extruded to get a Mesh. I use one Material for the whole game (Low Poly with color Atlas to reduce draw calls)
How should I optimize the rendering and the colliders for Mobile? Using common sense, I would say that I have to disable parts that are out of sight. My plan is to make chunks and combine the meshes into one mesh. That is all fine, but I assume it would be best to disable colliders also. My concern is that if I combine to many meshes, the active collider might be too big. Am I thinking correct? So I need some help to determine the size of my chunks.
Or is there a better way…?

If you do not have a performance problem, don’t take any speculative action. Obviously delete what you’re not using anymore, but don’t overthink it.

If you have a performance problem, don’t speculatively optimize either. Attach the Profiler and figure out where your performance problem is, otherwise you’re only tearing up your codebase for no benefit.

2 Likes