Apparently it lets me only reference other prefabs, but I am instantiating(don’t know if i’m using the word correctly, i’m referring to making gameObjects out of the prefab, like so ):
bullet = (GameObject)Instantiate (Resources.Load("Projectile"));
Is there a way to specify in the same code the parameter( it isn’t really a parameter, it is the public variable whose value we have to define), for a specified instance of the prefab, something like this ?
bullet.shoot.target = X;
In this example, shoot is the script attached to the prefab that bullet is an instance of, target is the public variable inside the shoot script, x is the name of the gameObject that we would use as a public variable in the script. The second part of the question is if there is a way of getting a list of all the gameObjects from a scene, being able to select which one you want by tags or by name, like so:
bullet.shoot.target = MainScene.getGameObject("Target");