Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Processing Tilemap Colliders with No Lag

Discussion in 'Physics' started by Jozzuph, Jan 3, 2024.

  1. Jozzuph

    Jozzuph

    Joined:
    Sep 12, 2019
    Posts:
    33
    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!
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,589