- Home /
Tons of Scripts, Doing Small things to game. Performance issuses in future?
Title pretty much explains it. lol Im just curious if having over 50 scripts doing only small things.. about 20 lines per script will hinder the game greater then having only a couple massive Script working things. Thanks :)
Answer by Eric5h5 · Sep 09, 2012 at 02:58 PM
Scripts only cause performance issues if they are doing anything. It doesn't matter how many you have or how they are organized. If you have 1 million scripts with 1000 lines each but none of them have any functions that are running, it will take 0 CPU cycles.
Awesome! Thanks. Ive been wondering about that question every time I made a new script. I have around 60 scripts all referencing each other via. "static var" would that cause any issues? So far my test game on my Android seem to be ok, but im far from finishing the game and have crazy amounts of scripting left to do.
Static variables can cause issues because static means there is only one instance of that variable per class, nothing to do with performance. But if you actually only want one instance, then it's fine.
Your answer
Follow this Question
Related Questions
Does comments reduce FPS? 1 Answer
Script Crashing Unity 1 Answer
How exactly Unity works (from programmer's perspective)? 0 Answers
Scripts on Terrain Trees 2 Answers
Is performance related to the script size that is called by GetComponent? 1 Answer