Legacy Documentation: Version 5.3
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Time.frameCount

public static int frameCount;

Description

The total number of frames that have passed (Read Only).

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { private static int lastRecalculation = -1; static void RecalculateValue() { if (lastRecalculation == Time.frameCount) return; } }

Note: frameCount starts once all Awake functions have finished. The frameCount value will be undefined during Awake functions.