HOW do I stop every animation and play idle animation only

so, I wanted my player to stop movement and play idle animation when dialouge enables PLEASE HELP I am stuck

PLAYER SCRIPT

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PLAYER : MonoBehaviour
{
//private SpriteRenderer _renderer;
public ParticleSystem dust;
public float speed;
public float jump;
public float move;

public bool jumping;
[SerializeField]  AudioSource airsoundeffect;
[SerializeField]  AudioSource runsoundeffect;
[SerializeField]  AudioSource jumpsoundeffect;

public Animator anim;
bool facingRight = true;

private shake shake;
public bool canmove;
public Rigidbody2D rb;

     void Start() {
      rb = GetComponent<Rigidbody2D>();
    anim = GetComponentInParent<Animator>();
    shake = GameObject.FindGameObjectWithTag("screenshake").GetComponent<shake>();
    Findstartpos();
    canmove = false;
    }
    void Awake()
     {

         DontDestroyOnLoad(this.gameObject);
     }
   
    void Update() {
      if(canmove = true){
     move = Input.GetAxis("Horizontal");
    rb.velocity = new Vector2(speed * move, rb.velocity.y);   
      }
    if (Input.GetButtonDown("Jump") && jumping == false)
    {
         CreateDust();
        rb.AddForce(new Vector2(rb.velocity.x, jump));
     
    }
    if(jumping == false){

      anim.SetBool("isjumping", false);
    }
    if(jumping == true){
          runsoundeffect.Stop();

      anim.SetBool("isjumping", true);
    }
    if(canmove = true){
    if(move >= 0.1f || move <= -0.1f)
    {
          
           CreateDust();
      anim.SetBool("isrunning", true);
    }
    if(canmove = false){
      anim.SetBool("isrunnig", false);
    }
    }
    else{
      anim.SetBool("isrunning", false);
    }
   
   if(move >= 0.1f || move <= -0.1f){
    if(!runsoundeffect.isPlaying)
    runsoundeffect.Play();
   }
   else
   runsoundeffect.Stop();
  if(move< 0 && facingRight)
        {
         
            Flip();
        }
        else if (move> 0 && !facingRight)
        {
            Flip();
        }
    }

       
  private void OnCollisionEnter2D(Collision2D other)
  {
    if (other.gameObject.CompareTag("Floor"))
    {
      if(!jumpsoundeffect.isPlaying)
      jumpsoundeffect.Play();
        CreateDust();
        jumping = false;
        shake.camshake();

    }
     else
      jumpsoundeffect.Stop();
  }
   private void OnCollisionExit2D(Collision2D other) {
   
        if (other.gameObject.CompareTag("Floor"))
        {
            CreateDust();
            jumping = true;
             if(!airsoundeffect.isPlaying)
               airsoundeffect.Play();
        }
        else
      airsoundeffect.Stop();
   }
 
  void Flip()
    {
      CreateDust();
        Vector3 currentScale = gameObject.transform.localScale;
        currentScale.x *= -1;
        gameObject.transform.localScale = currentScale;

        facingRight = !facingRight;
    } 

void CreateDust(){

  dust.Play();

}

private void OnLevelwasLoaded(int level)
{
  Findstartpos();


}
void Findstartpos(){
  transform.position = GameObject.FindWithTag("startpos").transform.position;
}
}

AND THIS IS IMPORTANT CONVERSATION MANAGER SCRIPT

public void StartConversation(NPCConversation conversation)
        {
            m_conversation = conversation.Deserialize();
            if (OnConversationStarted != null)
                OnConversationStarted.Invoke();
                playerscript.speed = 0f;
                playerscript.canmove = false;
            TurnOnUI();
            m_currentSpeech = m_conversation.Root;
            SetState(eState.TransitioningDialogueBoxOn);
        }

        public void EndConversation()
        {
            SetState(eState.TransitioningDialogueOff);

            if (OnConversationEnded != null)
                OnConversationEnded.Invoke();
                playerscript.speed = 16f;
                playerscript.canmove = true;
                
        }

This is not a helpful way to report problems. Let me offer you a better way to communicate technical issues:

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, especially any errors you see
  • links to documentation you used to cross-check your work (CRITICAL!!!)

You may edit your post above.