Would this script accurately display an in-game FPS rate? Currently I get 30 on my 3GS Code (csharp): using UnityEngine; using System.Collections; public class FPSDisplayScript : MonoBehaviour { float timeA; public int fps; public int lastFPS; public GUIStyle textStyle; // Use this for initialization void Start () { timeA = Time.timeSinceLevelLoad; DontDestroyOnLoad (this); } // Update is called once per frame void Update () { //Debug.Log(Time.timeSinceLevelLoad+" "+timeA); if(Time.timeSinceLevelLoad - timeA <= 1) { fps++; } else { lastFPS = fps + 1; timeA = Time.timeSinceLevelLoad; fps = 0; } } void OnGUI() { GUI.Label(new Rect( 450,5, 30,30),""+lastFPS,textStyle); } }
You might be better off with the fps script on the wiki: http://wiki.unity3d.com/wiki/index.php?title=FramesPerSecond --Eric
Hey thanks for that, im getting roughly the same numbers but the one I made gets updated less frequently. Which I guess is better performance wise but not testing wise. However no matter which fps meter I use I cannot get my scenes over 30 FPS. Even my menu runs at 30 FPS. Is there a hardcap somewhere I'm not seeing? I have my fixed timestep set to 0.05, physics influences set to 1, and I turned on interpolation on rigidobjects. Still no dice. Also is my main scene too much for anything other than 3gs? I currently have stats of 27 drawcalls, 29.1k tris, 13.5k verts, 10 textures @ 1.8mb. It runs great on my iphone even with AA on at the beautiful setting, but my artist said it runs like crap on his 3G. He was using a really old software version though.
in AppController.mm you can modify this line to change the frame rate cap: Code (csharp): #define kFPS 30.0 Your scene sounds way too heavy to run at a higher frame rate though.
You need to stay under 10k vertices and 20 drawcalls for your game to have a chance of performing well on a 3G. I have a 3G as my primary test device and that's what I've seen. The primary weakness of the 3G is its CPU is really slow so you won't be able to have much physics, AI, or any other CPU related activities going on.
Another option for a frame rate meter is FPS Graph. It also breaks down the CPU and Rendering computation, which can be helpful in debugging whether the GPU or CPU is your bottle-neck.
Smart FPS Meter allows you to quickly and easily getting and display performance info, frames per second and milliseconds data, usage memory and hardware info.