How To Optimize Your Unity Game With CullingGroups

Опубликовано: 16 Июль 2026
на канале: peartree games
2,355
49

Taking a look at the CullingGroup API and one potential use case of spawning enemies at various points in a level.

I had originally recorded an actual deep dive, going through all of the documentation on the Unity website, but it didn't really add much to the video though I encourage you to read it on your own.

There is plenty more that could be done to optimize and make this system better, but I wanted to focus on just setting up the CullingGroup. I also forgot to Dispose the CullingGroup in OnDestroy, be sure to do that!

Profiling - Before - After:
Total - 23ms - 5ms
Spawner - 14ms - 0ms
Enemy - 7.7ms - 1.9ms

Chapters:
00:00 Introduction
00:18 CullingGroup API
01:12 Scene Overview
02:44 Starting Code (Skip if just want to see CullingGroups)
05:45 Spawner Optimizations
09:30 Enemy Optimizations
10:33 Outro

Links:
[CullingGroup API](https://docs.unity3d.com/Manual/Culli...)
[riptutorial](https://riptutorial.com/unity3d/topic...)
[Sebastian Lague - Poisson Disc Sampling](https://github.com/SebLague/Poisson-D...)

My first released game Lucent Bounds: https://store.steampowered.com/app/17...