Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to deactivate VSync?

Discussion in 'Editor & General Support' started by engelcalderon, Nov 30, 2015.

  1. engelcalderon

    engelcalderon

    Joined:
    Mar 3, 2015
    Posts:
    8
    I have deactivated the VSync in my game, but yet I have the information in my profiler and is causing lags in my simply game.

    In the Quality Settings I have "Don't Sync", and in my Awake function I have this code: "QualitySettings.vSyncCount = 0;"

    Someone help me, i need turn off VSync.
     

    Attached Files:

  2. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
    Try Application.targetFrameRate = -1.
     
  3. engelcalderon

    engelcalderon

    Joined:
    Mar 3, 2015
    Posts:
    8
    @BenouKat Thank you very much, this works for me.
     
  4. rahulk1991

    rahulk1991

    Joined:
    Feb 22, 2019
    Posts:
    12
  5. IsakuStudios

    IsakuStudios

    Joined:
    Jun 28, 2020
    Posts:
    7
    Lol my game went from 100fps to 260fps :D but now it works a bit less smooth on the phone than before.
     
  6. Serbusz

    Serbusz

    Joined:
    Apr 12, 2014
    Posts:
    6
    from what i understand IOS caps the framerate at 30 if the framerate isn't specified with Application.targetFrameRate
    don't know if this applys to Android as well.
     
  7. jacksonkr

    jacksonkr

    Joined:
    Jan 22, 2013
    Posts:
    22
    I believe the correct way to do this is by using vSyncCount
     
  8. grimtin10_unity

    grimtin10_unity

    Joined:
    Feb 28, 2019
    Posts:
    10
    the author literally said vSyncCount is set to zero