Game Optimization

To make sure my game runs at the fastest FPS, I just watched a YouTube video that goes over some important aspects of this/ See" .Watch This Before Working on a Big Game in Unity - YouTube

Is the game more optimized if I simply have game objects inactive until needed and then SetActive() when they are needed and then set them inactive when I no longer need them, or is it better to instantiate them when needed and then destroy them when they are not needed. Consider memory and time involved in the game. When more memory is used, that will also (I believe) slow the game down.

Hi MarkWaldo,

As always: It depends. If you need a game object once every hour, destroying and reinstantiating would be fine. If you kill and respawn enemies bonus items and other things, an object pool would be a better way to improve the performance. In my personal opinion, “memory used” is less of a problem than a busy garbage collector.

Please feel free to ask our helpful community of students for additional opinions over on our Discord chat server. :slight_smile:


See also:

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms