Unity animation transition code being ignored

Hi. My animation transition code being ignored.

Here is my code:

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

public class PlayerController : MonoBehaviour
{
    private Animator PlayerAnimator;
    public Vector2 turn;
    public float HorizontalInput;
    public float rotation;
    // Start is called before the first frame update
    void Start()
    {
        PlayerAnimator = GetComponent<Animator>();
        Cursor.lockState = CursorLockMode.Locked;
    }

    // Update is called once per frame
    void Update()
    {
        rotation = Input.GetAxis("Horizontal") * 5.0f;
        transform.Rotate(0f, rotation, 0f);

        if (Input.GetKey(KeyCode.W))
        {
            PlayerAnimator.SetBool("IsMoving", true);
            transform.Translate(Vector3.forward * 10 *Time.deltaTime);
            
        } 
        else if (Input.GetKeyUp(KeyCode.W))
        {
            PlayerAnimator.SetBool("IsMoving",false);
        }
        if (Input.GetKey(KeyCode.S))
        {
            PlayerAnimator.SetBool("IsMoving", true);
            transform.Translate(Vector3.back * 10 * Time.deltaTime);

        }
        else if (Input.GetKeyUp(KeyCode.S))
        {
            PlayerAnimator.SetBool("IsMoving", false);
        }
        if (Input.GetKey(KeyCode.D))
        {
            PlayerAnimator.SetBool("IsMoving", true);
            transform.Translate(Vector3.right * 10 * Time.deltaTime);

        }
        else if (Input.GetKeyUp(KeyCode.D))
        {
            PlayerAnimator.SetBool("IsMoving", false);

        }
        if (Input.GetKey(KeyCode.A))
        {
            PlayerAnimator.SetBool("IsMoving", true);
            transform.Translate(Vector3.left * 10 * Time.deltaTime);

        }
        else if (Input.GetKeyUp(KeyCode.A))
        {
            PlayerAnimator.SetBool("IsMoving", false);
        }
        
        
    }
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Floor"))
        {
            PlayerAnimator.SetTrigger("climb");
        }
    }

}

Please help me fix this

Hello, @Bruh12997, do you get any errors when in play mode? My guess is that for some reason you are not getting a reference to your animator and therefore your transition is not being registered.

so honestly instead of using a collision i used a button to do the climb animation so its fixed now