- Home /
Why "Component.active = false" is not existing?
To dynamicaly deactivate components like scripts from a game object instead of complet deactivate the whole game object, could bring more flexibility in programming complex stuff with interaction between game objects. Has some one an idea of a workaround to deactivate a component or scripts from out another script via java script?
Answer by Dave-Carlile · Feb 14, 2013 at 11:54 PM
Many components have an enabled
property for this purpose. Scripts are among them.
http://docs.unity3d.com/Documentation/ScriptReference/Behaviour-enabled.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613092720im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Accesing components on multiple objects in scene 3 Answers
Can a script enable components? 2 Answers
Two AudioSource Components on one Gameobject? 1 Answer
Define game object. 0 Answers
Missing Components error 0 Answers