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?

???

YES

YourObject.GetComponent(Timer).enabled = false;

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.

thanks guys :slight_smile: