Performance Issues

Before you tell me to pickup some Viagra I’m talking about my game! Sorry, bad attempt at humor.

I recently released my first game on the Play Store and I noticed after playing a while the performance gets progressively worse. The game is a simple little Zombie shooting gallery style game where you blast zombies with fireballs. I notice a dip in performance after killing 100 or so zombies. I’m looking for ideas on how to find the source of the problem.

Here’s a list of what I’ve tried so far:

  1. got rid of instantiate/destroy and switched to object recycling/pooling and enable/disable for zombies, fireballs, most FX
  2. disabled audio
  3. disabled spawn FX
  4. disabled death FX
  5. commented my debug statements
    none of the above had any noticeable effect on performance

Before changing from instantiate/destroy to object recycling I disabled the script that makes the zombies move toward the player and allowed MANY to spawn, there was no noticeable performance hit until I destroyed several of them. Play store still has the version w/o object recycling for the zombies.

I don’t notice the performance hit when playing in the editor. Stats are as follows: 150+ fps on while playing in editor, Main Thread 902ms Renderer: 5.3ms, Draw Calls: 34, Tris: 782, Verts: 1.3k, Used Textures: 22-37.6MB, Render Textures: 6-6.8MB, VRAM Usage: 9.9 to 41MB, no shadows, animations.

As you may guess I’m pretty new to the whole programming/game dev thing but I’m doing my best to learn from my mistakes. Any input even and especially criticism is appreciated. If you have ideas on what else I could check to find the issue that would be great. I realise it’s a long shot w/o the code but I wouldn’t know what code to post at this point. If you like, here is a download link to the game:
ZombieBlast Infinity

Do you create new materials during runtime?

I will have a look at that thank you for posting Agent_007, I wasn’t aware of the Resources.UnloadUnusedAssets command so even if it isn’t my problem I still learned something, thank you!