Hello,

I have an empty game object, which has several child game objects. I would like to change the textures of some of the childs (only those with the name “platform”) to a new one.

How should I do it by script?

Thanks!

var yourTexture : Texture;

// Look for all renderers in the child of the current game object (the object to 
// which you attach this script)
var renderers : Renderer[] = gameObject.GetComponentsInChildren.<Renderer>();

if ( renderers )
{
    // Iterate through all renderers
    foreach(var rend:Renderer in renderers)
    {
       // Is the game object this renderer is attached to is named "platform"?
       if ( rend.name == "platform" )
       {
         foreach(var mat:Material in rend.materials)
         {
           mat.SetTexture("_MainTex", yourTexture);
         }
       }
    }
}

Also, Check out some types of textures you can replace:
http://unity3d.com/support/documentation/ScriptReference/Material.SetTexture.html