Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How can i get the actual/capped fps?

Discussion in 'Scripting' started by Nanako, Feb 14, 2015.

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    I'm using this stock script from the wiki: http://wiki.unity3d.com/wiki/index.php?title=FramesPerSecond

    And honestly, i'm pretty sure it worked fine in unity 4.5, but it doesn't now.
    My application has the target framerate set to 60 fps, so it's basically capped there. I'm designing my game around maintaining 60 fps as a constant/stable value, so my interest in a framerate meter is mainly to see when it dips below, and i'd like it to comfortingly show a static 60fps when nothing is wrong.

    However now, in unity 4.6, the fps counter is showing what i can only assume, is the framerate my computer is capable of, rather than the one it's actually putting out. In my fairly empty scene it's showing 300-400 fps, fluctuating now and then. This isn't helpful to me.

    any idea what might have changed to break it, and how i could fix it?
     
    Last edited: Feb 14, 2015
  2. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
  3. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Wait, 300 > 60. Am I missing something?
     
  4. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    the script used to display 60, now it displays 300-400. Something seems to have changed in upgrading to unity 4.6
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    if (fps>60) fps = 60;

    :)

    In your case of high fps (which is a great thing) I have no idea. My game is well above 60 (even though vsync is enabled) in 5.
     
  6. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    That doesnt sound good. That sounds like Vsync isn't working properly.
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I used fraps to measure it.