Search Unity

Application.targetframerate affects other running games

Discussion in 'Windows' started by dhon2407, Dec 6, 2019.

  1. dhon2407

    dhon2407

    Joined:
    Jun 9, 2018
    Posts:
    12
    Hi,

    I could manually adjust my application.targetframerate while running the game. If I adjust it to 60, it seems other games running on computer are affected, like for example Dota 2, will also limit framerate to 60. If i change my games application.targetframerate to 120, Dota 2 will also increase its fps. How can i fix it?

    Unity version 2019.3.0b8
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    That... makes no sense. Setting target frame rate just changes how long the Unity sleeps every frame. It doesn't touch any system wide settings. Are you observing the changes in other games while your Unity game is running, or even after your game is closed?

    Secondly, may I ask why are you using TargetFrameRate at all? VSync in most cases is a much superior way to do it as it uses your GPU to limit frame rate, rather than inaccurate sleeps. Using TargetFrameRate might result in stutters, uneven frames and increased input latency especially when you're running above 60 fps.
     
  3. dhon2407

    dhon2407

    Joined:
    Jun 9, 2018
    Posts:
    12
    It's only when the unity game is simultaneously running with other game.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Well, I have no idea why that's happening. However, I suggest switching to using VSync on your game instead of Application.targetFrameRate. Not only it will likely solve your problem but it will also make your game run smoother.

    If the same thing happens with VSync, I'll need an ETW trace to investigate this further.