"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Low frame rate in android app (less than 20fps)

 
 

I've been trying to make my game run with a specific frame, when I try to run on unity, it works exactly like I wanted, but when I put in my Android phone, the frame goes to 25 fps or more... How could I solve it?

-> I tried to use Application.targetFrameRate

-> change AndroidUnityPlayer.cs

I'm using this code

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 = 12;

} 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; } } }