Hi! I looked in the forums as well, and all they really say is use the GameObject.AddComponent API, but well, that doesn’t seem to work.
Here’s my code (C#):
GameObject someGameObject = (GameObject)Instantiate(somePrefab, position, rotation);
BlueColour script = someGameObject.AddComponent<BlueColour>();
I run the scene, and nada, the script does not execute.
I tried script.enabled = true;
too and nothing.
Help? Please…
Thank you!