- Home /
Question by
HolBol · Sep 08, 2010 at 02:40 PM ·
gameobjectenable
enable scripts/ components on other gameobjects for a different gameobject?
i want to be able to turn a script on remotely from a script on a gameobject other than the main gameobject- how?
Comment
Best Answer
Answer by AliAzin · Sep 08, 2010 at 05:36 PM
You should set the enabled flag on your component to false like this:
var targetObj : GameObject;
targetObj.GetComponent(yourComp).enabled = false;
result : BCE0019: 'enabled' is not a member of 'UnityEngine.Component'.
Your answer
Follow this Question
Related Questions
How can I access other scripts and their functions? 3 Answers
How to make text appear when moving next to an object? 3 Answers
Object won't reactivate or activate with button press. 2 Answers
I need to know how to make a gameobject rotate over time.Please Help. 1 Answer
GetInstanceID ?????? 2 Answers