- Home /
Question by
LiamThompson17 · Nov 11, 2021 at 07:37 AM ·
cameravraugmented reality
How do you cap the frame rate of a camera?
I am trying to code a very simple app for Google Cardboard.
All I want the app to do is look like real life (via the phone camera, of course) - but the view is capped at 5FPS. In other words, it is as if you are in a laggy video game in real life!
I would really appreciate any help, as I'm very new to Unity!
Comment
Answer by RayyFarr · Nov 11, 2021 at 01:22 PM
I am not sure about vr. But i found this in the internet using UnityEngine;
public class frameRate : MonoBehaviour
{
//works only while in the game.
void Awake ()
{
// must set vsync to 0
QualitySettings.vSyncCount = 0;
//set desired frame rate
Application. targetFrameRate = 30;
}
}