i have a simple script for play the animation.
but i still not know why my code doesn’t works.
can you help me? this is my code :
int i = 1;
Animator anim;
// Use this for initialization
void Start () {
anim = GetComponent<Animator> ();
StartCoroutine (animation1());
}
IEnumerator animation1(){
while(i==10){
anim.Play ("idle awal");
yield return new WaitForSeconds (2.5f);
anim.Play ("obstacle");
yield return new WaitForSeconds (1f);
anim.Play ("obstacle out");
yield return new WaitForSeconds (4.5f);
i--;
}
}
please help me