I'm trying to set an exposed variable on a gameobject that has not yet been instantiated.
var s:GameObject=GameObject.Find("instantiateMe"); var instances:GameObject; instances = Instantiate(s,pos,rot); instances.GetComponent(ScriptName).id=id;
Using the usual method above, I get this fatal error: "BCE0005 Unknown identifier: ScriptName"
`instantiateMe` (the object to be instantiated) has a script named `ScriptName` in it, with the global variable `id`...
Using this method, I get "BCE00018: The name 'ScriptName' does not denote a valid type ('not found')."
var s:GameObject=GameObject.Find("instantiateMe"); var instances:GameObject; instances = Instantiate(s,pos,rot); var script:ScriptName=instances.GetComponent(ScriptName); script.id=id;
ScriptName.cs is a cs file! But, I'm using js on the other ones as I am more familiar with that.