- Home /
For loop causing low frame rate
Hey guys im trying to print a list of information using a for loop and GUI.label in c#. There isn't much of a problem at first but as the list gets bigger, my frame rate in the game drops significantly.Is there a way to optimize the performance or use another way to render the information? Here is the code. I am still new to Unity and would greatly appreciate any advice in this matter.
for(int i = 0; i < Player_Character.PlayThroughIndex;i++){
GUI.Label(new Rect(200,100+(i*60),100,100),"Total Time: "+Player_Character.TotalTimeTaken[i],InfoStyle);
GUI.Label(new Rect(700,100+(i*60),100,100),"Accuracy: "+Player_Character.Accuracy[i]+"%",InfoStyle);
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613120758im_/https://answers.unity.com/themes/thub/images/avi.jpg)