hey can sombody tell me what i did wromg in this script?
var script1 : ScriptName;
script1 = gameObject.GetComponent("Script1");
var script2 : ScriptName; script2 = gameObject.GetComponent("Script2");
function Update() { if( Input.GetKey("X") ) {
if(script1.enabled)
{
script1.enabled = false;
script2.enabled;
}
else
{
script2.enabled = false;
script1.enabled;
}
}
}
i want to switch betwean 2 scripts Script1(Shoot) and script 2 (RapitShoot). its not my script i got i from someone the two scripts are on my Spawnpoint for the bullet do i place this script if it works allong with the scripts 1 and 2 on the spawn point. that when i push x than i go from script 1 on the spawnpoint to script 2 i hope you know what i mean tnx