How to turn off Script at the start of animation, ant turn on at the end of it.

Hello to everyone, I am wondered by a question, how can we turn off the scripts for example of control and play an animation, and then turn them back on, so the cut scene may be clean will be clean.
If anybody has an idea please help.

You could use a boolean variable to let the script know whether or not it can operate. When the animation starts then set the boolean to false. Create an if statement in your update function that only calls if the boolean is true so that it can avoid calling any unwanted functions when the animation is playing. When the animation is done then set the boolean back to true.

GameObject.Find (“NameOfGameObjectToWhichTheScriptIsAttached”).GetComponent().enabled = false;

Or you can enable the script in a similar manner.