- Home /
targetframerate is being ignored
hi,
i set the targetframerate in a javascript file attached to the MainCamera, but when i build and run the game ignores the command and runs at max speed.
Heres the code:
var speed:float;
function Awake () {
// Make the game run as fast as possible in the web player
Application.runInBackground = true;
Application.targetFrameRate = 3;
}
function Start () {
}
function Update () {
if(Input.GetKey("w"))
{
transform.position.y += speed * Time.deltaTime;
}
if(Input.GetKey("s"))
{
transform.position.y -= speed * Time.deltaTime;
}
}
is there any way to fix this?
thanks in advance!
Comment
Answer by JoeStrout · May 07, 2017 at 11:00 PM
Probably you have "V Sync Count" set to something other than "Don't Sync" in the Quality settings. Application.targetFrameRate is ignored in that case.
Your answer
![](https://koobas.hobune.stream/wayback/20220613065300im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Lower Frame rate for less polys ? 1 Answer
Target frame rate between scenes 1 Answer
Framerate independent character movement 1 Answer
Target Frame Rate Not Working 1 Answer
WaitForTarget FPS - VSync 1 Answer