Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by digzelot · Aug 01, 2017 at 04:25 AM · androiddebugframerate

Unity 2017 frame rate capped?

I'm trying to determine the frame rate of my game - I open a new project with nothing but the default 3d scene (Main Camera + Direction Light) and hit play - the frame rate in stats window bounces between 68 and 70 fps.

This script (which I want to use in order to see the fps on the actual Android device) says the frame rate is consistently @ 59 fps

 using UnityEngine;
 using System.Collections;
 
 public class TestFPS : MonoBehaviour
 {
 
     private int FramesPerSec;
     private float frequency = 1.0f;
     private string fps;
 
     void Start()
     {
         StartCoroutine(FPS());
     }
 
     private IEnumerator FPS()
     {
         for (;;)
         {
             // Capture frame-per-second
             int lastFrameCount = Time.frameCount;
             float lastTime = Time.realtimeSinceStartup;
             yield return new WaitForSeconds(frequency);
             float timeSpan = Time.realtimeSinceStartup - lastTime;
             int frameCount = Time.frameCount - lastFrameCount;
 
             // Display it
 
             fps = string.Format("FPS: {0}", (frameCount / timeSpan));
         }
     }
 
     void OnGUI()
     {
         GUI.Label(new Rect(Screen.width - 100, 10, 150, 20), fps);
     }
 }
 

a) I'm wondering why the fps is so low with nothing in the scene?

b) why are the frame rates off by so much?

c) anyone suggest another method for testing fps on android devices?

Thanks for any help

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by x4637x · Aug 01, 2017 at 04:42 AM

You might want to turn of V-Sync in unity, is locate in Edit -> Project Setting -> Quality, change V Sync Count to "Don't Sync".

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image digzelot · Aug 02, 2017 at 01:36 AM 0
Share

Thanks, that worked. The script is way off compared to states menu, however, and vsync is enabled on android anyway so I can't see what the actual frame rate is on the device regardless. I was hoping to be able to closely monitor fps while developing on android to quickly catch issues, but it looks like ill find another way.. thanks tho, that worked in editor!

avatar image Menyus777 digzelot · Aug 02, 2017 at 09:52 AM 0
Share

then mark his answer as answered

avatar image digzelot Menyus777 · Aug 02, 2017 at 12:05 PM 0
Share

Thanks for your help, $$anonymous$$enyus777. All my questions were not answered

avatar image x4637x digzelot · Aug 03, 2017 at 01:02 PM 0
Share

If you want to know more detail about your game performance , you could always check it in Unity's Profiler. Just need to enable "Development Build" and "Auto-connect Profiler" in Build Settings, and make sure your device and your unity machine are in the same network. Once you run your game on the device, Unity should let you chooses it under "Connected Player" in Profiler. From there you could easily tell how performance been taken by different modules.

avatar image
1

Answer by mayur7garg · Nov 28, 2018 at 06:11 PM

@digzelot


a) The FPS is in the editor can be low because of many reasons -

  • Computer specifications aren't great. Having more RAM, better CPU and a larger GPU will greatly improve that.

  • That FPS is with the editor running which itself consumes a lot of computing resources and hence lowers the FPS. (You can take a Windows/Mac build of your project to see the improvement in FPS when the editor is not running.)

  • Graphical and Quality settings. (However their impact will be minimal on an almost empty project). Try tweaking those.


b) If you are talking about the difference in FPS in the editor and that of the Android build, that is because displays on most mobile devices have refresh rates capped at 60Hz (Limitation of mobile displays). So you cannot have an FPS of over 60 on any mobile device (except the Razor phone which is capped at 120Hz). 59 is probably the best you can get. (Your script won't even display 60 cause of minor minor fluctuations while refreshing. To see how close to 60 you can get, just try printing 1/Time.deltaTime every frame.)


c) Your script is a good implementation of displaying FPS. If you wish, you can try downloading FPS assets from the store.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

138 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Problem with android on screen GUI 1 Answer

Motorola issues 0 Answers

Very Bad Performance on Android 3 Answers

Performance issues with touch/android build. 0 Answers

Is Screen.Orientation always portrait in Debug Mode? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges