- Home /
Question by
Ricky Stefani · Apr 11, 2011 at 08:32 PM ·
gameobjectgetcomponent
Deactivate Script
Hi... so... I'm trying deactivate a script with "GameObject.GetComponet("script").active = false;" in C# but this deactivate also the GameObject... why the GameObject is deactivate and how can I to make to deactivate the script???
thanks!
Ricky Stefani
Comment
Answer by DaveA · Apr 11, 2011 at 08:38 PM
Get the script component (GetComponent) and set enabled = false;
Well... I tried to use also Component script = GameObject.GetComponent(nameScript); script.active = false;
thanks!
Your answer
Follow this Question
Related Questions
GetComponent not Returning 1 Answer
C# GetComponent Issue 2 Answers
gameObject.GetComponent("Script").enabled = true not working 5 Answers