Hi
I have on my scene 3 gameobjects with tag “Wrog” and thej all have 1 child element “zaznaczenie”.
I want to create function with will find all gameobjects with tag Wrog and then set active=false on child element zaznaczenie. How can I accomplish this?
Im trying with this, but no luck:
function odznacz_wszystkich()
{
//narazie to nic nie robi
for(var fooObj : GameObject in GameObject.FindGameObjectsWithTag("Wrog"))
{
//Debug.Log("Znaleziony:" + fooObj.name);
var zaz:Transform=fooObj.transform;
var zaz2:Transform=fooObj.transform.FindChild("zaznaczanie");
//Debug.Log("Znaleziony:" + zaz.name);
zaz2.active=false;
}
}