Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

There is a big bug and I don't know how to fix it elegantly!

Discussion in 'Animation' started by Ridiculously, Jul 13, 2020.

  1. Ridiculously

    Ridiculously

    Joined:
    Jul 13, 2020
    Posts:
    6
    two lines:
    animator.Play("xxx");
    animator.GetCurrentAnimatorStateInfo(0).IsName("xxx");
    and then it returns FALSE???
    I dont know why is this,please help me !!!
     
  2. Ridiculously

    Ridiculously

    Joined:
    Jul 13, 2020
    Posts:
    6
    animator.Play("slash1");
    Debug.LogError(animator.GetCurrentAnimatorStateInfo(0).IsName("slash1"));
    yield return new WaitForEndOfFrame();
    Debug.LogError(animator.GetCurrentAnimatorStateInfo(0).IsName("slash1"));

    and just wait for a frame it changes false to true
    i dont know how to express my holly S***
     
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,491
    Ridiculously likes this.