- Home /
Is it possible to turn a script On/Off ? (Solved)
Is it possible to turn a script On/Off in the same (or similar) way that you would setActive = True/false with as game object ?
I have a timer, more precisely a countdown running in my game and after a given time I want certain game objects to become active. (stay active for a while, then the countdown to start again)
OR... would I be better just adding a timer to the already existing script on the game objects?
???
Answer by Qasem2014 · Jan 02, 2015 at 04:25 PM
YES
YourObject.GetComponent(Timer).enabled = false;
Answer by BMayne · Jan 02, 2015 at 04:37 PM
Hello there,
Yes you can but it's not truly off. Only the Unity functions stop being called. The script will still work if somewhere else it's being called.
Your answer
![](https://koobas.hobune.stream/wayback/20220613175427im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
CountDown Timer Help (Seconds problem) 2 Answers
Timer script running too fast 1 Answer
Enable/Disable script with timer 1 Answer
Time does not start counting down when need to 1 Answer
physics.OverlapSphere colliders 1 Answer