Need help debugging my lag problem in Android.

Hi,

I’m facing a performance problem that I can’t seem to fix.

I have a very simple game that is similar to Fruit Ninja but I instantiate objects at top of the screen and they move downward in a 2D camera and player interacts with them with drag/swipe.

Problem is, FPS is dropping with no indication in Profiler, even when profiling on a device.

I’m using 2D toolkit and not Unity’s native 2D and game is fairly simple, how can I determine what causes the lag when there is no indication in the profiler?

I’ve tested on several phones and tablets with various Android versions and it’s better on more high end devices but it still lags even on those devices.

Is there anyway I can track this and find root of it?

Thanks

I found that there was two main issues when I encountered problems like this. Colliders are very intensive on Android, simplify everything to Box Colliders if there if there any Mesh or Sphere Colliders. Make sure that any objects in the background are collision free.

A second thing I found out was the Instantiate and Destroy methods are quite intensive as well, after a bit of research I found out about Object Pooling. It basically means reusing any objects by just altering their properties to make it look like they are new ones.

So in your Fruit Ninja type game, you might only have 10-20 objects, and whenever one of them is hit it will move back to the initial position and change to another mesh.

This is Unity’s tutorial on it, it might explain it better than I did. http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/object-pooling

I hope that all makes sense and it helps a little.