UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"Get fps on screen"
using UnityEngine; using UnityEngine.UI; public class FPSDisplay : MonoBehaviour { public Text fpsText; private float deltaTime; // Update is called once per frame void Update() { deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f; float fps = 1.0f / deltaTime; fpsText.text = string.Format("FPS: {0:0.0}", fps); } }