Lag on first gameobject enable
Hello! I have read a lot of topics about this but I couldn't find right answer.
I am instantating all needed gameobjects like bullets, explosions in the Awake. Then when I need one I just enable one from array by :
array[bulletCounter].SetActive(true);
On first enable of some objects (some of bullets/explosions) I get lag and fps goes from 60 to 25 for a less then second.
What could be the problem?
Show the relevant code from OnEnable() that's causing it
Your answer
![](https://koobas.hobune.stream/wayback/20220612002523im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Instantiated child object position slightly off. Any ideas? 0 Answers
What is the most efficient way to spawn in a lot of cubes, like 10k? [c#] 2 Answers
Instantiating blender Gameobjects creates serious lag 0 Answers
2D game lagging 1 Answer
How to find the active random object in an object pool array 0 Answers