Freezing position of character when animation plays

Hi I have a problem right now of when an animation plays my character is still able to move so his feet stop moving but he is still moving kinda thing. I’m wondering if there is any way to freeze the location of the character for the duration of the animation

You could clamp in your movement into an if-statement, depending on an animation bool.

Animator anim;

if(anim.GetBool("IsCastingSpell") == false)
{
    //Movement stuff here
}