function Update(){
if (System.IO.File.Exists(“filepath.txt” ))
{
animation.Play("myanimation");
}
}
If i enter a correct file path, will this script play the animation upon the file being created in that directory.
function Update(){
if (System.IO.File.Exists(“filepath.txt” ))
{
animation.Play("myanimation");
}
}
If i enter a correct file path, will this script play the animation upon the file being created in that directory.
I would not put that check on “Update”, since it looks more like a one-shot function, however, the answer is YES.
And to tell the truth, you can put ANY self-updating condition in the if evaluation, which will lead to ‘myanimation’ play when true.