title: anim.SetBool("IsWalking", walking) error in unity animator
body: <p>In the Unity learn section - survival shooter, I am getting an error shows the following error</p>
  <blockquote>
  <p>Type &quot;UnityEngine.Animation&quot; does not contain a definition for &quot;SetBool&quot; and no extension method &quot;SetBool&quot; of type &quot;UnityEngine.Animation&quot; could be found. Are you missing an assembly reference?</p>
  </blockquote>
  <p>I have checked the name of files and components.</p>
  <h1>Code</h1>
  <pre><code>using UnityEngine;
  
  public class PlayerMovement: MonoBehaviour
  {
      public float speed = 6f;
  
      Vector3 movement;
      Animation anim;
      Rigidbody playerRigidbody;
      int floorMask;
      float camRayLength = 100f;
  
      void Awake()
      {
          floorMask = LayerMask.GetMask(&quot;Floor&quot;);
          anim = GetComponent&lt;Animation&gt;();
          playerRigidbody = GetComponent&lt;Rigidbody&gt;();
      }
      
      void FixedUpdate()
      {
          float h = Input.GetAxisRaw(&quot;Horizontal&quot;);
          float v = Input.GetAxisRaw(&quot;Verticle&quot;);
  
          Move(h, v);
          Turning();
          Animating(h, v);
      }
  
      void Move(float h, float v)
      {
          movement.Set(h, 0f, v);
          movement = movement.normalized * speed * Time.deltaTime;
          playerRigidbody.MovePosition(transform.position + movement);
      }
  
      void Turning()
      {
          Ray camRay = Camera.main.ScreenPointToRay(Input.mousePosition);
          RaycastHit floorHit;
  
          if(Physics.Raycast (camRay ,out floorHit, camRayLength, floorMask))
          {
              Vector3 playerToMouse = floorHit.point - transform.position;
              playerToMouse.y = 0f;
  
              Quaternion newRotation = Quaternion.LookRotation(playerToMouse);
              playerRigidbody.MoveRotation (newRotation);
          
          }
      }
  
      void Animating(float h, float v)
      {
          bool walking = h!= 0f || v!= 0f;
          anim.SetBool(&quot;IsWalking&quot;, walking);
      }
  }
  </code></pre>