ok so…
I’m at the optimization stage of my game, its a 2D top down shooter as seen in the image
I’m testing it on a basic crappy android LGMS323 because I want decent performance on even the crappiest phones in order to cover as many people as possible.
My issue is the following:
Once around 70+ zombies are visible on the screen like in the image below, my FPS starts QUICKLY tumbling from 60 to around 30-35. My draw call count is 8.
Each zombie has:
Box collider 2D(size adjusted in real time with animation frames), Rigidbody2D(never sleep)
a child containing: box collider, rigidbody KINEMATIC
The turret the zombies are colliding with contains:
circle collider 2d, NO rigidbody(i don’t know if rotating the turret counts as moving a static collider)
I have tried the following to fix the fps drop:
Removing all sounds from zombie prefab → didn’t affect FPS
Made zombie box collider2d constant size for all animations → didn’t affect FPS
deleting animator component to stop all animations → didnt affect FPS
removing zombie rotation code(uses ATAN function which i heard was expensive) → didnt affect FPS
playing around with build settings(i tried everything such as different rendering, different api levels, multithread toggle, graphics level, etc) → didnt affect fps
removing applyforce from zombie → didnt affect fps
changing sprite texture quality to lowest quality of “32” → didn’t affect fps
changing fixed timestep from .02 to .04,.05. even .1 → didn’t affect fps
played around with the physics2D,3D settings → a bit over my head, didn’t affect fps
I disabled collision of zombies with each other using ignore layers in the physics2D,3D options-> didn’t affect fps!
Deleted the child from zombie prefab(which contained box collider and rigidbody KINEMATIC) → gained about 15 FPS(but removes important functionality)
Deleted box collider 2D from zombie, → gained around 10+ fps(obviously losing major functionality)
So there you have it… the only 2 ways i was able to increase fps was to completely get rid of the colliders which made my game mostly nonfunctional
The 2D collider is used for collisions with the turret as well as to facilitate natural bumping with the other zombies(no collision calls for zombies), and for bullets to hit the zombies.
The 3d collider is used to enable collision with a particle system flamethrower, since particles cannot collide with 2d colliders(unfortunately…)
I cannot think of another way to implement the features that the colliders provide.
Please help, I’ve really tried hard to do this on my own and I’m kind of stuck here.
I was thinking of maybe replacing 2D colliders with Physics2D.OverlapCircle functionality, but I’m not sure how i’d know when to call that function unless i called it EVERY FRAME in which case won’t it become even worse than colliders?
If i had Unity pro i’m sure the profile would help pinpoint what’s causing this but I have only Unity free and it’s SUPER FRUSTRATING!
I’d be more than happy to provide more information if i missed something important.
Thanks. ![]()
edit:
some extra information just in case
I set Application.targetFrameRate = 60;
VSYNC is OFF in quality setting
All quality settings are set to MINIMUM


I guess you have Unity Free and not Unity Pro? The profiler would be a great help here (Pro only). Also - try to run in Unity editor and try using the stats window (top right of Game-tab). Free and pro.
– ivomarelI've looked at the stats but have no idea what values would be bad and what would be good?
– luniacHow are you instantiating your GameObjects in a scene? Do you do it as needed? Do you pool objects and requeue them in the pool for use when needed with perhaps a dynamic increase based off assuming n number of zombies but needed more than the pool provided?
– LandernSomeone correct me if I'm wrong but... 70 colliders stacking and colliding with each other sounds like A LOT. Especially on mobile. 70 separate colliders all around the screen might be no problem but with 70 box colliders all trying to get to the same place there could easily be 70x4 collisions to resolve each Update()
– NoseKillsAnyone got anything? at this point ill take any idea to try out... i just dont understand how just the existence of the colliders slows down the game even if theyre not interacting with anything such as when i turn them off... i can supply the zombie script if needed...
– luniac