Add/Removing Child objects from a list?

Apparently in order to move multiple instantiated objects, they need to be in a list. Which is great and all.

But I have 0 clue how to do such a thing and any attempt at searching for a decent answer leads to the MSDN page which shows a terrible way to list. Well it’s terrible in the sense that it’s impossible to understand for newer people.

So here is my question:

How do you do such a thing?

So using that link that was provided. I came up with the following:

public void PlatformAdd()
{
  pList.Add (PlatformOBJChild);
}
public void PlatformRemove()
{
 pList.Remove(PlatformOBJChild);
}

if (MaxCount < 11)
		{
			PlatformOBJChild =Instantiate(PlatformOBJSel, new Vector3(1.0f+ iX,1.0f+iY,0.0f),
			Quaternion.identity) as Transform;
			iX +=Random.Range(3.0f,6.0f);
			iY +=Random.Range(1.0f,2.0f);
			MaxCount++;
			Debug.Log("MaxCount " + MaxCount);
			PlatformAdd();
		}



	void OnCollisionEnter(Collision other)
	{
		if (PlatformDestroyed == true)
		{ 
			return;
		}
		if (other.collider.tag == "Platform")
		{
			ss.PlatformRemove();
			Destroy(other.gameObject);
			Destroy(gameObject);
			PlatformDestroyed = true;
		}
		if (other.collider.tag == "PlatformEnd")
		{
			Destroy(gameObject);
			Debug.Log("Platform reached END");
			PlatformDestroyed = true;
		}
		else
		{
			return;
		}

	}

The problem I am having now is that it deletes the object and then there is a Missing(TransformObject) in the List array.

How is this fixed? Or what else can I do to fix this?

Are you trying to move objects in general objects as in transform, moving them in a unit as in transform, or under a different directory. (to a different file) If you are trying to move individually, there shouldn’t be a problem and I’m unqualified to answer this question, however if you’re trying to move objects as a unit. use this batch of code.

var aparent : Transform;
var bchild : Transform;

function groupingfunction()
{
     bchild.parent = aparent;
}

function separationfunction()
{
     bchild.parent = null;
}

child is only used for things such as the count of the children and can’t be referenced directly since it is the ‘list’ I believe you are looking for. I hope this helps and choose the parent of group carefully because that’s the only name you’ll see without opening the list via the arrow next to the name.