Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Problem with animations

Discussion in 'Animation' started by zZ_Serk7, Mar 17, 2021.

  1. zZ_Serk7

    zZ_Serk7

    Joined:
    May 15, 2020
    Posts:
    1


    Hi guys, I created a simple transition influenced by a parameter called isWalking, as you can see in the video, the real problem is that I can't get an animation change going from the "idle" state to "walk". I can get a change of animation only if i set "isWalking" as true before the runtime.

    I also coded the transition, setting "isWalking" as true when I press "w", the parameter sets to true, there is a change of state, from "idle" to "walk" but there is no change of animation

    //other scripts...
    void Update()
    {
    if(Input.GetKey("w"))
    {
    transform.Translate(speedPlayer * (Vector3.back * Time.deltaTime));
    animator.SetBool("isWalking", true);
    }
    //other scripts...
    }