Parameter 'Walk' doesn't exist?

I’m trying to make walk animation. But when I try to change animation idle to walk, ıt doesn’t work. It says 'Parameter “Walk” doesn’t exist’but I added parameter and script works. I can manually change parameter and it works(walk animation is playing). But when I try to change via script, ıt doesn’t work.

Here are codes

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Controller : MonoBehaviour
{

    private Rigidbody rb;

    private float xPos;

    Vector3 playerMovement;

    [SerializeField] Animator anim;
    
    
    


    private void Awake() => rb = GetComponent<Rigidbody>();

    private void Start()
    {

        
        xPos = transform.position.x;

    }








    // Update is called once per frame
    void Update()
    {
        Move();
        
    }

    private void Move()
    {
        
        float mH = Input.GetAxis("Horizontal");

         playerMovement = new Vector3(0, 0, mH);

        rb.AddForce(playerMovement * 2f);

        anim.SetFloat("Walk", 1);

        transform.position = new Vector3(xPos, transform.position.y, transform.position.z);
        

    }


    
}

Your code and animator seems to be alright. Is the script on the same object as that animator. If this is the case you already have an animatır component on the scripts object but wrong controller is asigned to it.

Just to add to this, I recently came across this, there was no typo in my paramter either and the controller looked fine but the issue was that I had renamed a prefab since I was playing around with it. because of it the controller looked like it was pointing to the correct animator but it wasn’t just a heads up