Unity2D: My player can not move when animator is on , when animator is off player can move .(code is here)(condition is "isRunning").

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

public class playercontroller : MonoBehaviour
{
    private Rigidbody2D rb;
    public float speed;
    Animator anim;
    public float jumpForce;
    private bool aord; // (A or D)
    
    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
        anim = GetComponent<Animator>();

    }

   void Update()
   {
aord = (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.A));
      if(Input.GetKey(KeyCode.D))
       {
       rb.velocity = new Vector2(speed, rb.velocity.y);
         anim.SetBool("isRunning",true);
       }
        else if(Input.GetKey(KeyCode.A))
       {
       rb.velocity = new Vector2(-speed, rb.velocity.y);
        anim.SetBool("isRunning",true);
       }
       else if (aord == false)
       {
        rb.velocity = new Vector2(0, rb.velocity.y);
        anim.Play("Idle");
        anim.SetBool("isRunning",false);
       }

   }
  
   
}

You would have to create a transition in the animator, for when a condition is true or false. I would recommend using floats.