I am building a simple URP scene (Unity 2022.3.4 LTS) with one cube in front of the camera, but I am unable to achieve a frame rate above 30 FPS on my Xiaomi Mi A2 device. Despite it not being considered low-end and having a 60 Hz screen refresh rate, I’m still experiencing limitations. It is interesting why very basic scene cannot go up above 30 FPS. Are there any approaches to achieve the goal of 60 FPS?
Hi. Here are a couple of solutions, I hope one of them works:
- Target Framerate
By default, Unity locks fps for specific values, according to the current platform. Unity Documentation says that the default for Android is 30, which is used by most Android devices. Also, it says: The default targetFrameRate is a special value -1, which indicates that the game should render at the platform’s default frame rate.
Also, you can have as many fps as possible while running your game in the editor, it may be 150 or more, but it’s really bad practice to have more than 60 (max value for iPhones and some Androids). If you have more than 60 fps you can’t actually see the difference because the device’s display can’t actually render more than 60 frames per second, but it takes battery and CPU resources and all those calculations (for extra 60+ fps) are useless and even bad.
To make your fps more than 30, you can set it to 60 as you are doing in your code. Just paste this in the Start() of any script and attach it with a Game Object: Application.targetFrameRate = 60;
- Other Devices
There could possibly be an FPS cap for the Android Device you’re using. Please test the game on a Desktop or/and other Andoird Devices and see the difference.
- Accurate FPS Measurement
There could also be a potential issue with how are calculating FPS for your game. Here’s a simple and easy way of doing it via C#: Simple Framerate FPS Counter in 30 SECONDS! - YouTube
- Dynamic Scene
If there is just a single cube in the scene and a stable camera then there’s no need for more FPS. Technically, if there is no movement, then only 1 frame is showing up all the time, even though the screen is refreshing at 60Hz. Please try out adding a simple animation and see the variable FPS, it should most probably have a positive impact .