Game Lag after Build for Android

How can i fix the game lag in android after build, the lag isn’t coming while playing in editor, but its coming after build.

Computers are generally more powerful than phones, just because the game is running at 60fps on your computer doesn’t mean you’ll get the same fps on mobile, in this case you need to have a sense of what could be the cause, it could be graphics, it could be code, whatever it might be, it needs to be turned down to run on phones.

The basic Unity Android profiler will cap your game at 29.97 fps by standard, this is probably the reason why you are suffering from low performance.

NOTE: Many android devices cap framerate to 30 FPS to increase battery life. This has nothing to do with Unity.

Insert this to one of the scripts being used when opening the application,

// Make the game run as fast as possible
Application.targetFrameRate = -1;
// Limit the framerate to 60
Application.targetFrameRate = 60;

You can also change the targetFrameRate to other values too, remember that this will impact the battery/cpu usage of the phone.

Let me know if this works!