- Home /
Unable to enable script
Hey there! So I have been at this for quite awhile and it seems that I can not enable a script from a different game object.
IE. Press play button -> some script on another game object is enabled
As far as I am away my code is right, since I can modify variables within that same script, but I just can't seem to enable the whole thing...?
I must be doing something wrong, but I just can't figure out what! :(
Thanks!!
#pragma strict
var spawnArea : crateSpawnScript;
var colorChange : GameObject;
function Start()
{
spawnArea = GameObject.FindGameObjectWithTag("spawnArea").gameObject.GetComponent(crateSpawnScript);
colorChange = GameObject.FindGameObjectWithTag("spawnArea");
}
function OnMouseDown()
{
spawnArea.enabled = false;
spawnArea.testNumber = 20;
colorChange.renderer.material.color = Color.blue;
renderer.material.color = Color.blue;
Debug.Log("been pressed");
}
Comment
sigh
I am a moron.
spawnArea.enabled = TRUUUUUEEEEEEEEE
lol. Sorry guys. ^_^
Your answer
Follow this Question
Related Questions
enable/disable specific components 3 Answers
disable/enable script js 2 Answers
I need to find a Script and Disable/enable it.. 1 Answer
Disable a script from another script 2 Answers
switch scripts? 1 Answer