I would like to make a function that changes a variable immediately, but return to a default value before the next update
function Start () { test(); } function Update () { if(testing) { Debug.Log("frame tested: "+Time.frameCount); } } private var testing : boolean; function test() { testing = true; yield; testing = false; }
in this sample code the variable keep true in the first and second frame, but I want a true value only in the first frame