Deactivating Child Game Objects

I have imported several obj files which I assume become Game Objects:

[4182-deactivate+issue3.png|4182]

They are all children of a prefab GameObject:

![alt text][1]

This game object is instansiated in code, several times.

for each of the instances I would like to disable all but one model per instance.
This is the code:


// get model name from setup file and disable all tagged as "Airframe" 

// whose name does not match the model name in the setup file.

if (tokens[kObjectToken] == SystemTypes.kModel) {

   var modelName = tokens[kValueToken];

   var models = subassembly.FindGameObjectsWithTag("Airframe");

   for (var m in models) {

      if (m.name != modelName) {

         m.active = false;
         LogClass.AddLine(m.name + " deactivated");
      }
   }
}

It works in that it finds the correct name of the model but nothing is disabled. When I look a the instantiated GameObjects, they are still enabled.

Thanks for any feedback!
Joe

This is not the best solution, but if you just want them to disappear, you can try unrendering them:

instead of:

m.active = false;

Try:

// make the object invisible
m.renderer.enabled = false;