how can i disable a the player controller script while an animation is playing?

sorry im extremly noob at at coding. i’ve made a kinda long respawn animation on entry and it works great the problem is that im able to move the character while the animation is playing. how can i fix this?

  1. Disable the component in the animation itself
  2. Disable it through code, here is the link or just use GetComponent<PlayerController>().enable = false;