Specifies the target frame rate at which Unity tries to render your application.
Accepts an integer > 0, or special value -1 (default).
Desktop
0, then Application.targetFrameRate chooses a target frame rate for the application. If vSyncCount != 0, then targetFrameRate is ignored.QualitySettings.vSyncCount = 0 and Application.targetFrameRate = -1, content is rendered unsynchronized as fast as possible.QualitySettings.vSyncCount over Application.targetFrameRate because vSyncCount implements a hardware-based synchronization mechanism, whereas targetFrameRate is a software-based timing method and is subject to microstuttering.vSyncCount = 0 and using targetFrameRate will not produce a completely stutter-free output. Always use vSyncCount > 0 when smooth frame pacing is needed.Web
0, then Application.targetFrameRate chooses a target frame rate for the application. If vSyncCount != 0, then targetFrameRate is ignored.QualitySettings.vSyncCount = 0 and Application.targetFrameRate = -1, content is rendered at the native display refresh rate.Application.targetFrameRate because vSyncCount implements a hardware-based synchronization mechanism, whereas targetFrameRate is a software-based timing method and is subject to microstuttering.vSyncCount = 0 and using targetFrameRate will not produce a completely stutter-free output. Always use vSyncCount > 0 when smooth frame pacing is needed.vSyncCount = 0 and targetFrameRate to an arbitrarily high value will not exceed the display's native refresh rate, even if the rendering workload is sufficiently low.Android
targetFrameRate to control the frame rate of your application. This is useful for capping your application's frame rate to make sure your application displays smoothly and consistently under heavy rendering workloads. You can reduce your application's frame rate to conserve battery life and avoid overheating on mobile devices.QualitySettings.vSyncCount = 0 and Application.targetFrameRate = -1, content is rendered at a fixed 30 fps to conserve battery power, independent of the native refresh rate of the display. QualitySettings.vSyncCount > 0 are ignored.vSyncCount = 0 and targetFrameRate to an arbitrarily high value will not exceed the display's native refresh rate, even if the rendering workload is sufficiently low.Application.targetFrameRate to the value from the Resolution.refreshRateRatio field of the Screen.currentResolution property.Application.targetFrameRate is rounded down to the nearest number that does. For example, when running on a 60 Hz Android display, and Application.targetFrameRate = 25, content is rendered at 20 fps as 20 is the highest number below 25 that divides 60 evenly.iOS
targetFrameRate to control the frame rate of your application. This is useful for capping your application's frame rate to make sure your application displays smoothly and consistently under heavy rendering workloads. You can also reduce your application's frame rate to conserve battery life and avoid overheating on mobile devices.QualitySettings.vSyncCount = 0 and Application.targetFrameRate = -1, content is rendered at a fixed 30 fps to conserve battery power, independent of the native refresh rate of the display. QualitySettings.vSyncCount > 0 are ignored.vSyncCount = 0 and targetFrameRate to an arbitrarily high value will not exceed the display's native refresh rate, even if the rendering workload is sufficiently low.Application.targetFrameRate to the integer representation of the screen's refresh rate. This can be retrieved from the value of the Screen.currentResolution.refreshRateRatio property. For example, Application.targetFrameRate = (int)Screen.currentResolution.refreshRateRatio.value;.Application.targetFrameRate is rounded down to the nearest number that does.
XR platforms
XR platforms ignore both QualitySettings.vSyncCount and Application.targetFrameRate. Instead, the XR SDK controls the frame rate.
Unity Editor
In the Editor, Application.targetFrameRate affects only the Game view. It has no effect on other Editor windows.
Additional resources: QualitySettings.vSyncCount, Screen.currentResolution.
using UnityEngine;
public class Example : MonoBehaviour { void Start() { // Limit framerate to cinematic 24fps. QualitySettings.vSyncCount = 0; // Set vSyncCount to 0 so that using .targetFrameRate is enabled. Application.targetFrameRate = 24; } }