- Home /
How can I improve performance?
I created a not so complex game with unity (compared to the ones i've seen), for Ios. When I test it and press play, it is really slow and lags, not only on the ipad, but on my mac. Guess it'll be much faster when I build the app, but it'll be a headache to build it and compile it every time a change a variable(I say this because speed of some objects, and timing mattter a lot in the game that I've created, so they need fine tuning). My qquestion is how can I improve the performance of playing the game inside unity? It would be great a help for me.
Answer by numberkruncher · May 10, 2012 at 11:59 PM
I have found that games run slow in the Unity editor when there are multiple scene views. Ensure that you tick "Run Maximized" before running because this does improve performance massively (in editor).
As for poor performance on iOS I have pretty much always found the root cause to be shaders (in my game projects). Always make sure that you are using the mobile friendly equivalents of the built-in shaders, and optimize homemade ones!
Another major performance issue on iOS is draw calls. Run the game in the editor and select "Statistics". Check how many draw calls there are because an excessive number here would indicate one cause for poor performance.
There are so many things that contribute to poor performance but the Unity documentation contains some excellent advice: http://unity3d.com/support/documentation/Manual/Optimizing%20Graphics%20Performance.html
Once go Edit > Graphics simulation > select Open GL 1.0 and now once run your game may be you will get result.
Answer by Drakestar · May 10, 2012 at 08:33 PM
Don't assume that the game will magically run faster after you build it. Start by reading this article, and come back for specific questions: http://robotduck.wordpress.com/2011/08/05/code-optimization-in-unity-part-2/
Answer by yetanotherday · May 10, 2012 at 08:58 PM
Everything counts. Shaders, vertexes, size of textures and their options. Its not just about number of stuff that appears on screen (but draw calls is very important! learn how to optimize them). Even simple things like smoothing groups, number of bones, projected thing and lights can add a lot to performance. Its just one big problem and you need to be aware of almost everything that is going on in your game... this kind of question was answered a lot of times on unity answers. Just spend some time on searching. Screenshot or more broad description of problem would help to throw some more advises.
I use primitves(sphere) in the scene that are built in unity, and materials built-in unity, that have no texture on them, just a single color assigned to them, that's all.