Through a co-routine batch system, I’m doing some heavy dungeon procedural generation on tilemaps. The only problem I’m having is the step where I paint all the walls on my wall tilemap with a composite collider. Doing this with the batched process requires the collider to be constantly adapted, which lags even more than without the batch system. However, without the batched system, there is still a heavy lag spike of several seconds when walls are loaded. I know the physics side of things causes lag because of the Profiler.
The system also works in batches to allow for infinite generation, so generating everything simultaneously with a loading screen is not an option. Any ideas as to how I can overcome this problem? I’m still somewhat new to Unity, so I may be overcomplicating things / missing something obvious. Thanks for all of the help!