- Home /
low fps on android game?2D
I have made a 2d game where the player drags (simple touch, drag and drop)stuff in 4 baskets.The thing is that when i run it in my cellphone(redmi note 4x )the fps seems choppy i guess it is less than 20 fps...what might be the problem here???
Answer by jihadkhawaja · Dec 21, 2019 at 02:09 AM
In player settings , others tab be sure the Graphics APIs are only GLS 2.0 and GLS 3.0 and remove vulkan
Answer by Felipe669 · Dec 20, 2019 at 06:57 PM
Hi there!
Have you checked the profiler yet? You can usually find usefull information about your game's performance there.
If you don't see anything suspicious in the profiler, there could be an exception being thrown.
Do you see anything in Unity's console? If there's any exception being thrown, the performance can drop considerately.
If not, maybe you're using some API that only throws exceptions on mobile devices, such as Google AdMob's API. In this case, you can't see any errors in the console, but they could be causing the performance drop on your phone.
Try deleting any unnecessary code from your project and building it again. (Make a backup before doing this, obviously).
Hope it helps!
Answer by Lafikobra · Dec 21, 2019 at 06:42 PM
Well try the obvious first: Add an empty gameobject to the scene with this script on it:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Framerate : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Application.targetFrameRate = 60;
}
}
Answer by Mrniceplant · Dec 21, 2019 at 10:18 PM
i found the problem...It seems that i had too many variables declared in update,in multiple spripts.I made a new project and rewrote the code with improvements and now its fixed.Thank you for your time.