Hey guys how to find gameObjects which are disabled.
[EDITORS NOTE – YOU CAN NOT “disable” gameObjects. You can set them active or not.}
i.e whose enabled property is set to false.
[EDITORS NOTE – gameObjects do not have that property.}
This is what i want to do
As you can see there are three Spheres which are connected with each other.
Now while dragging any of the sphere I disable the Cylinders which connects this Sphere to other spheres.
And after drag is done i want to enable this cylinders again. Something like this
.
Here is what i am doing :
var element2:GameObject=testscript.elementarrays[sphereIndex];
elementInfo2=element2.GetComponent("ElementInfo");
Element2=elementInfo2.Element;
Again, something strange is going on if your Find() is failing with active game objects. Disabling the Renderer does not deactivate a game object. Any chance there is an extra space in the name, or the case is different? Walk the code in the debugger and/or do a Debug.Log() at the point of the Find(). Compare the name in the Hierarchy. Make sure the above script is only attached to the game object(s) you expect.
gameobject.setActive(false / true)