I keep trying not to ask a question until I have exhausted my other options. I just started trying to read, write and comprehend script a few days ago. If I ask a stupid question or make hilarious syntax mistakes, forgive my ignorance.
I want to trigger an animation after my character has been motionless for 5 seconds. I think I’m on the right track but I can’t quite get there.
I want the animation to trigger after the wait, be interrupted by any movement and be able to trigger again if the wait condition is met. Also, how would I set up the transitions efficiently in the Animator?
Any help would be greatly appreciated.
void Start()
{
anim = GetComponent<Animator>();
StartCoroutine("waitFiveSeconds");
}
IEnumerator waitFiveSeconds()
{
yield return new WaitForSeconds(5);
anim.Play("Wiggle");
}
}
}