I am calling Animation.CrossFade inside OnMouseDown even to make a transition of animation state within 3 seconds interval. I want to destroy the game object right after the transition finished but not before that. Below is the code:
void OnMouseDown()
{
GetComponent<Animator>().CrossFade("statename", 3f);
Destroy(gameObject);
}
But it is being destroyed before the transition is done. How can I make it wait for the transition to finish, then destroy it?