depreciated for child objects?

I know that we're supposed to use .active for GameObjects and .enabled for components (makes sense to me), but i'm getting the " '' is obsolete. the active property is deprecated on components." warning with my code below. I'm trying to hide a few objects at startup - some are meshes so I could use renderer.enabled, but others are particle systems. I'm trying to cater for both in my For loop:

function Start(){
   var objs = GameObject.FindGameObjectsWithTag("water_effects");
   for(var obj in objs){ = false;

I turn them on later with:

thisObj.transform.Find("my_childs_name").active = true;

and this is where i'm getting the warning. But children are still gameObjects, aren't they? Unity seems to be suggesting they're components. Or is it just being ultra careful and warning me about any use of .active?

Also, if there's a more common method of doing this, i'd be glad to hear it.


thisObj.transform.Find("my_childs_name").active = true;

With that line you are obtaining a reference to your child's transform, NOT the gameObject, therefore changing it to:

transform.Find("my_childs_name") = true;


thisObj.Find("my_childs_name").active = true;

Should work. Also its worth mentioning that if you access a child's transform or gameObject often, you should store a reference to save processor time.

GameObject.Find returns a gameObject, but Transform.Find returns a transform.

So you would need to use enabled or take out the transform and just say


for active to work. Here's the page on Transform.Find();

Transform Script Reference

Edit: Corrected for future reference. You should not use transform.enabled.