Performance issues after putting it on iPhone

Now, I understand the iPhone is slower of course but for what I’m doing, there should definitely be no performance issues.

Firstly, when I drag objects around, it is kind of slow. Also it’s pretty unresponsive when it comes to touching.

There also seems to be an issue with positioning and screen parameters. For example, on the top right of the scene (when run within Unity), there is a Label that says: “The current distance is x”. X being some number. And I placed it such that it is aligned on the top right. However, when put on the iPhone, the label is more towards the right and goes off screen…

Any ideas? I can try and give more info on request.

Have you set the screen orientation?

file:///Applications/Unity%20iPhone/Unity%20iPhone.app/Contents/Documentation/Documentation/ScriptReference/iPhoneSettings-verticalOrientation.html

Yes I set it to false.

Hmm so it seems only my buttons and labels positioned improperly. Everything else is fine. Still no luck on the performance though.

What exactly is your app doing? You say it shouldn’t have any performance issues, but clearly it does. Unresponsive touches usually go hand-in-hand with low framerates, so you must be doing something fishy. Here’s a list of common ways to kill your framerate:

  • using onGui
  • having a lot of draw calls
  • having a lot of individual update functions
  • heavy skinned meshes with high number of influences per vert
  • excessive poly counts, particularly on skinned meshes

Any leads?

I don’t have excess Poly Counts or any of that but I am using OnGUI for drawing labels and buttons. I fixed the unresponsiveness it was actually my own little error. I’m going to try commenting it out completely to see if it fairs better.

I’m not sure of the technical reasons, but onGui is unacceptably slow in unity iPhone. For anything during gameplay, I’d recommend using skinned meshes comprised of textured planes, or the popular SpriteManager community project (of which there have been a few permutations). OnGui can really only be used for fairly static, non-performance-critical menus.

Yea my code became MILES faster commenting out OnGUI. I was originally using it for adding Labels to certain game objects so I’ll just find another way.