Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

I noticed that the explosions part of BulletFury (BulletExplodeOnHit.cs) is very heavy on FPS (100 FPS without explosions, only 25 FPS with explosions in the demo).

Looking at the code, I see that new explosion GameObjects are being instantiated on every collision.  Unity instantiation is famously slow, so I'd recommend using object pooling in order to reuse a large amount of the explosion prefabs and avoid the Instantiation slowdowns. Should speed things up by 2x-3x I would guess.

Coroutines are also somewhat slow, so that could be sped up by using a timer on the explosion prefab, or even better using the new Async Await.  But the biggest performance gains will come from object pooling here.

Just wanted to give everyone else a heads up in case they're looking for ways to improve performance.

(1 edit) (+1)

totally agree, I changed it to be a bit more performant but these are great tips nonetheless