my lagging game

hello world,firstly,may Allah save us all from crona virus.
I am making a game,and that is running properly in editor,and also on my pc,when i build it,but when i build and play it on my android,it lags a lot,game size is just 37 mb,i dont know what is the problem,plz help.

The hardware on your PC is undoubtedly orders of magnitude more powerful than your android device. You’ll need to run the profiler against a build running on your android device to get the specific answer to where your performance problems are coming from.

Common pitfalls though include using shaders which aren’t optimized for mobile, using too complex of models, attempting to display too many even simple models at once, using post processing effects not optimized for mobile, using textures of too high quality. Generally doing anything which puts stress on the GPU, since mobile GPU’s are extremely limited compared to even integrated graphics on PC.

Also, default resolutions are typically very high on these little devices.

2 Likes

To add to what Joe-Censored said, the size of your game is mostly irrelevant to how it runs. You can write code that brings down any CPU in just a couple lines of code. You can do something similar for the GPU. Even in more realistic use-cases, while 3D models make up most of the game size (and thus could be a reason for a game running slowly), you can procedurally generate entire worlds with a file of just a couple kilobytes.

So as Joe said, you will have to look at the profiler to figure out your problem. You probably wasted a lot of ressources somewhere. Look for spikes, or things that eat up most of your frametime in general, then try to decrease this. And, again, your smartphone is way less powerful than your computer.

3 Likes

Here are some links that may help. The[ Profiler ](http:// Unity - Scripting API: Profiler)namespace and SnapdragonProfiler for android. Render namespace. They will give you more information

2 Likes

Closed, wrong forum. Read the descriptions and post in the proper areas.

1 Like