I have a variable: boolean, that under certain conditions turns from false (default value) to true for a limited time and then automatically it goes back to false.
While it's true (eg for 5''), I want a function to be called repeatedly (this function makes an SM2 sprite appear and disappear fast, as an eye candy)
Using the following lines, doesn't work:
function Start (){
while (myBoolean == true){
InvokeRepeating("MyEyeCandyFunction",0,0.4);
}
}
You will need to keep track of how many times your eye candy function is called and then set myBoolean to false after a certain amount of calls. If you don't want this to be called every frame check against Time.time to see how often to call it. I am in a rush but post a comment if you want me to get more in detail.