High FPS in Editor, but fixed at 60FPS in Build
Hi,
I am measuring the FPS rate counting the Update() calls in my game. In the Editor, FPS are large, peaking at ~200FPS. However, when I build the game into an .exe, FPS are fixed at ~60FPS. What can be causing this issue?
I've tried to disable VSYNC, but the problem persists.
Answer by Radivarig · Mar 28, 2021 at 10:54 AM
https://docs.unity3d.com/ScriptReference/QualitySettings-vSyncCount.html https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html
using UnityEngine;
public class Example
{
void Start()
{
// Disable vSync
QualitySettings.vSyncCount = 0;
// Make the game run as fast as possible
Application.targetFrameRate = 300;
}
}
replace "Application.targetFrameRate = 300;" with "Application.targetFrameRate = -1;" to have it uncapped
Your answer
Follow this Question
Related Questions
Built Game different than the game in the editor - What to do? 0 Answers
Game Doesn't Work Properly in Editor but Works When Built 0 Answers
Button no longer plays animation after updating 0 Answers
Line Renderer not showing in build mode 0 Answers
is there any way to select gameobject by script in hierarchy ? 0 Answers