Prefab instance, how to set script variable?

Hi,

I’d like to know what the best solution for this issue.
Basically I want to instance some prefabs from a script.
The prefab has a script attached which allow to specify the color used by the shader (for example)
When I use The instance function I can specify the position / orientation
But I haven’t find a way to specify this color variable for the script used by the prefab ?
Any idea ?
Looks like it could work using some static variable but I’m sure there a more elegant solution
Thanks in advance
oX

From the docs on prefab instantiation:

function FireRocket () {
    var rocketClone : Rigidbody = Instantiate(rocket, transform.position, transform.rotation);
    rocketClone.velocity = transform.forward * speed;
    // You can also acccess other components / scripts of the clone
    rocketClone.GetComponent(MyRocketScript).DoSomething();
}

The relevant part is:

rocketClone.GetComponent(MyRocketScript).DoSomething();

You should be able to do something like:

myClone.GetComponent(MyScript).colorVariable = Color(1,.4,.3,1);

Hope that helps and I’m not totally off base.

Perfect this is exactly what I need !!! Thx so much