Log in or register to post comments

#define kFPS 60

November 19, 2012 - 3:42pm #1

where do i exactly define the fps in the exported xcode project from unity.   (#define kFPS 60)  where is this?

#define kFPS 60

September 18, 2015 - 6:31pm #6

This code doesn't works well when I extend it to android

#define kFPS 60

November 20, 2012 - 11:08am #5

look like the script work just inside unity, but not when is on the iphone.

#define kFPS 60

November 20, 2012 - 7:35am #4

No, you need it in a script.

Below is an example script that you could use - simply attach it to your ARCamera.

This will also display the current FPS, though you will need to experiment a little.

Please also try the Unity forums at the Unity web site to get up to speed with Unity a little more.

N

using UnityEngine;
using System.Collections;

public class FPSScript : MonoBehaviour {
public float updateInterval = 0.5F;
private float lastInterval;
private int frames = 0;
private float fps;
void Start() {
lastInterval = Time.realtimeSinceStartup;
frames = 0;

Application.targetFrameRate = 60;

}
void OnGUI() {
GUILayout.Label("" + fps.ToString("f2"));
}
void Update() {
++frames;
float timeNow = Time.realtimeSinceStartup;
if (timeNow > lastInterval + updateInterval) {
fps = frames / (timeNow - lastInterval);
frames = 0;
lastInterval = timeNow;
}
}
}

#define kFPS 60

November 20, 2012 - 4:43am #3

i write bellown the lines?

// kFPS define for removed

// you can use Application.targetFrameRate (30 fps by default)

Application.targetFrameRate  60

kFPS 60

 

 

like this?

 

 

 

#define kFPS 60

November 20, 2012 - 4:09am #2

Normally in AppController.mm

However its use is now deprecated

// kFPS define for removed

// you can use Application.targetFrameRate (30 fps by default)

..and it is recommended to use Application.targetFrameRate and just set it to what you want it.

You ought to go to the Unity forums on the Unity web site and do a searchfor this  so you can find help more quickly.

N

Log in or register to post comments