Animator behaving weirdly
I have made a new main menu for my game. It functions great overall, but only the animation is a bit scuffed..
When going to the options menu and back to the main menu, the "MMBG_FadeIn" animation starts playing somewhat reverse (?) during the transition to the "MMBG_Idle" animation.
Here's a video showing it: https://www.youtube.com/watch?v=LzA0CwMZC-Q
Here's the code that is "activating" these animations:
public void ShowMenu ()
{
StartCoroutine(ShowMenuEnum());
}
IEnumerator ShowMenuEnum()
{
OptionsAnim.SetBool("idle", false);
OptionsAnim.SetBool("fadeOut", true);
yield return new WaitForSeconds(0.3f);
OptionsMenu.SetActive(false);
MainMenu.SetActive(true);
MainAnim.Rebind();
MainAnim.Update(0f);
MainAnim.SetBool("fadeOut", false);
MainAnim.SetBool("fadeIn", true);
yield return new WaitForSeconds(1.3f);
MainAnim.SetBool("fadeIn", false);
MainAnim.SetBool("idle", true);
}
public void Showoptions()
{
StartCoroutine(ShowOptionsEnum());
}
IEnumerator ShowOptionsEnum()
{
MainAnim.SetBool("fadeIn", false);
MainAnim.SetBool("idle", false);
MainAnim.SetBool("fadeOut", true);
yield return new WaitForSecondsRealtime(0.2f);
MainMenu.SetActive(false);
OptionsMenu.SetActive(true);
OptionsAnim.Rebind();
OptionsAnim.Update(0f);
OptionsAnim.SetBool("fadeOut", false);
OptionsAnim.SetBool("fadeIn", true);
yield return new WaitForSecondsRealtime(0.45f);
OptionsAnim.SetBool("fadeIn", false);
OptionsAnim.SetBool("idle", true);
}
As you can see, I already tried using Rebind() and Update(0f) I don't know what is happening here and ask you guys for help! Thanks in advance!
Your answer
Follow this Question
Related Questions
Why is the last frame of the animation not triggering? 0 Answers
How do I know what animation I can transit to in the animator, from my current animation? 0 Answers
How do you make sure that when you land on an object, an animation starts? 0 Answers
Animation from child object overrided by its parent and won't show in game window 0 Answers