How to make a wall move when all pickups are deactivated?

I’m new to Unity and I’ve just finished the first tutorial “roll-a-ball”. to work a bit further, i’m trying to make the North wall move when the 12 Pickups are deactivated. I know how to make the wall move, but i don’t know how to make the “if” part. i’m trying to script the wall, so that I can use it later as well in other levels. I’m quessing it’s something like this: if 12 gameObject with tag “Pickup” are deactivated, then transform.position = new vector(3,0,10). I don’t know in which void I should place this and wich trigger or something this is. Any ideas?

You need to store those pickups in an array, and use a boolean to check if they are deactivated. You also will use a simple for loop to iterate through the array to check each gameobjects state of being active or not. Then you can simply move your wall when the boolean you used is true.

private GameObject[] pickUps;
private bool isAllDeactivated;
private bool canCheck;

void Start()
{
pickUps = GameObject.FindGameObjectsWithTag("Pickup");

}

void CheckIfDeactivated()
{
  for(int i = 0; i < pickUps.Length; i++)
  {
   if(pickUps*.activeInHiearchy)*

isAllDeactivated = false;
else
isAllDeactivated = true;
}
canCheck = true;
}

void Update(){
if(isAllDeactivated && canCheck)
{
// move your wall
}

}
You can call CheckIfDeactivated function by just typing CheckIfDeactivated(); whenever you want, you can also make it check in the Update function but it will be very expensive according to the performance issues.