Ryujose
1
Hello community.
I’m trying to access an script as component inside a GameObject.
This is the code:
Component playerSpawnScript = _scriptContainer.GetComponent(typeof(PlayersSpawn));
But when I try to set it to Active, I don’t see any property or method that let me do it.
I’m with .NET 4.6 experimental.
Regards!
Hellium
3
PlayersSpawn playerSpawnScript = _scriptContainer.GetComponent();
playerSpawnScript.enabled = true ;
public GameObject gameObjectWhichHasTheScriptAttached;
//write this where you want to disable the script
gameObjectWhichHasTheScriptAttached.GetComponent<nameOfScript>().enabled = false;