- Home /
Huge Framerate Drop
I'm working on a 2D game. When the camera moves it instantiates about 10-15 UI texts on the screen to show specific things. When it does that, the framerate drops from 100fps to 10fps! This is not normal.
Here's the profiler:
Can anybody hint on what's going on??
Have you tried creating these beforehand and just enabling them when needed? That saves all the instantiation overhead.
That I cannot do because the text being instantiated has numbers written on it and those numbers are created on runtime depending on where the camera looks.
I mean the components themselves. Enable them and then just change the text property with whatever values you need them to be.
I've seen this happen a lot in previous versions of Unity. It seems to be the font-texture-generating engine taking a while to generate the dynamic font textures. Same thing used to happen with Text$$anonymous$$eshes
It's kinda unpredictable. Sometimes it causes the whole game to freeze for a while. Sometimes it doesn't.