hi
I have an issue regarding frames if someone can help me out in that
I want to add a condition in update that if frames are incremented to 30 call a function
I am stucked on this
I even use StartCoroutine() so that it can wait for 20 seconds but still its not working
I am using this code in update()
public bool frames = true ;
public int counter = 0;
void Start () {
}
void Update(){
int frameNos = Time.frameCount;
counter++;
if (frameNos == 30) {
if(counter == 30){
Debug.Log (counter);
testFunction ();
counter = 0;
}
}
}
What condition should i add so that my counter counts next 30 frames and so on …
Please help
Any help will be appreciated.
Thanks in advance