- Home /
Get how many frames have passed in the current scene?
Hello everyone, I was wondering how I could count how many frames have passed in the current scene. What I'm trying to do is this: At the start of the scene, one of my objects will go invisible. So what I'm basically trying to do is something like this:
if (Time.frameCount <= 1){
//do something
}
I hope you guys can help, thanks! ^ -^
Comment
Time.frameCount will count how many frames have passed however there is no guarantee your script will be called before the value reaches 1. If you want something to happen at the start you could put it into the Start function, providing the object is enabled.
$$anonymous$$G
void Start()
{
// go invisible
}
Your answer
Follow this Question
Related Questions
How do i create a level lock system? 1 Answer
pre-load multiple scenes but only activate one 0 Answers
Reduce 'Levels' or Scene File Size 1 Answer
Where is scene data stored? 1 Answer