Stopping movement when animation is playing

Hey guys, so I have an issue where my attack animation will play, but the player can still move during the animation. I’ve tried just setting it’s translation to zero, but it still moves. Here my code on how i move and play the animations:

using UnityEngine;
using System.Collections;

// Require these components when using this script
[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(CapsuleCollider))]
[RequireComponent(typeof(Rigidbody))]
public class Wolf_AnimationInput : MonoBehaviour {

    public float animSpeed = 1.5f;				// a public setting for overall animator animation speed
    public float lookSmoother = 3f;             // a smoothing setting for camera motion
    public float moveSpeed = 2.0f;
    public float rotateSpeed = 180;
    public float smooth = 0.5f;

    private Animator anim;
    private AnimatorStateInfo currentBaseState;// a reference to the animator on the character
    private CapsuleCollider col;		// a reference to the capsule collider of the character
    private CharacterController controller;
    private Transform _mytransform;

    static int idleState = Animator.StringToHash("Base Layer.Idle");
    static int runState = Animator.StringToHash("Base Layer.Run");
    static int attackState = Animator.StringToHash("Base Layer.Attacks");
    static float translation;

	// Use this for initialization
	void Start () {

       

        _mytransform = transform;
        anim = GetComponent<Animator>();
        col = GetComponent<CapsuleCollider>();
	
	}
	
	// Update is called once per frame
	void Update () {

        translation = Input.GetAxis("Vertical") * moveSpeed;
        currentBaseState = anim.GetCurrentAnimatorStateInfo(0);

        MovePlayer();
        PlayerAttack();
        RotatePlayer();

        /*         //------Saving for camera use------//
            Quaternion target = Quaternion.Euler(0, tiltAround, 0);
            transform.rotation = Quaternion.Slerp(transform.rotation, target, Time.deltaTime * smooth);
        */
	}

    void MovePlayer()
    {		
		

        anim.SetFloat("Speed", translation);
        anim.speed = animSpeed;

        translation *= Time.deltaTime;
        transform.Translate(0, 0, translation);

        
        
    }

    void PlayerAttack()
    {
        if (currentBaseState.nameHash == idleState)
        {
            if (Input.GetButtonDown("Attack") && translation < 0.01)
            {
                anim.SetBool("Atk", true);
               
            }
            else
            {
                anim.SetBool("Atk", false);
            }

        }
    }

    void RotatePlayer()
    {
        if (Mathf.Abs(Input.GetAxis("Horizontal")) > 0)
        {
            _mytransform.Rotate(0, Input.GetAxis("Horizontal") * Time.deltaTime * rotateSpeed, 0);
        }

        if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
        {
            transform.RotateAround(transform.position, transform.up, 180f);
        }
        else
        {

        }
    }
}

Wrap your MovePlayer() in a check to see if your animation’s “Atk” bool is set or not.

if (!anim.GetBool("Atk"))
     MovePlayer();

or do the same for the relevant section of code inside MovePlayer();