- Home /
 
Problem in reloading animation at interval time
I have an animated prefab .
At the start of scene this prefab start an animation.... I want that after 20 seconds its animation returns at initial state and play again.
I have tried to invoke this code
 function myObjAnimation(){
     myobj.GetComponent.<Animation>().Play();
     myobj.GetComponent.<Animation>().Rewind();
 }
 
               with
  InvokeRepeating("myObjAnimation",20, 20);
 
               in Update()
but only the first animation it's executed, on next invocation the animation is rewinded but remains freezed at initial state.
               Comment
              
 
               
              Your answer