- Home /
Best Unity configuration for 2D games on iPhone
Hey guys,
i have some questions.
I'm currently working on a 2D game for the iPhone.
Everytime I try to import a high quality image, for example an jpg. it always get kinda "washed out" when i try to display it, through a material or guiTexture.
What am I doing wrong?
another question:
I never get more than 30FPS on my iPhone 4, even when I'm only displaying a title screen with a gui texture. When I'm moving a simple gameobject, and let the camera follow, the followeing is very choppy and sluggish, the FPS at this time is around 29,5-30.
Is there a setting which prevents the game to run smoothly? I mean the iPhone is surely capable of handling at least 60 fps. What am i doing wrong?
and my last one :)
what is the best way to use backgrounds or textures in general in a 2d Game? Currently I have a big plane, which i equip with a material, which has the texture i want. The camera is directly above and configured to "orthographic".
This has the negative aspect, that the texture in materials always gets stretched if I want to make a level bigger, and therefore have to change the tiling settings to fit again. Is there another way? How does it Zombieville for example?
I really appreciate any help.
This is many questions, and so not suitable for this site. Ask multiple questions or take it to the forum.
Answer by Jessy · Mar 01, 2011 at 02:50 PM
Use a better compression setting. Use the Advanced mode, and the per-platform override. You're probably using PVRTC.
To set the desired frame-rate, open your XCode project generated by Unity iOS, and select the AppController.mm file. Locate and change #define kFPS 30 to a desired value, for example:
define kFPS 60.
http://unity3d.com/support/documentation/Manual/iphone-Optimizing-MainLoop.html
I assume you're using a built-in Unity plane. Never use that. Learn to UV a quad.
thanks, now it runs smooth as silk :) What are the downsides of increasing the FPS? I mean, why is it configured to 30 by default?
Currently I'm using a giant plane, with 3*50 Scale. I attached a material, with the texture.
So you're saying that I should use a giant cube ins$$anonymous$$d of a plane? What would change?
Increased FPS = decreased battery life. And if you can't hit 60, anything about 30 is wasted. As I said, never use the Unity plane in an actual game; it's 200 triangles and you only need 2, unless you need vertex lit specular highlights. $$anonymous$$odel a quad at the size you need, and UV it appropriately. Not a cube. A quad is two triangles in a plane, that share an edge.
"define kFPS" is not used anymore. Use this ins$$anonymous$$d. (setting it to 60 gives best results for iPad)