- Home /
How to stop a script from executing?
I have a script disable another script as follows: script.enabled = false;
However, I've found that the script continues to execute after it's been disabled. Is there a way to entirely stop the execution of a script?
Answer by jmparavicini · Jul 20, 2020 at 09:46 AM
As per this answer, only the following Methods get disabled: Awake, Start, Update, LateUpdate, FixedUpdate
Disabling a script only stops Unity from calling these methods on the disabled object. If you manually call these functions or your code lies in different methods, then there is no stopping it through setting the enabled flag to false.
Your answer
Follow this Question
Related Questions
failed to create file? (trying to create a launcher.) Failed To create File. 2 Answers
How can a character following another predict his trajectory? 0 Answers
Using GetComponentsInChildren to detect renderer 1 Answer
How to move Groups of Objects using a Script? 0 Answers
How to disappear an object and get input from user? 0 Answers