transform.position of list member

Hey, how can i get the transform.position of a Gameobject in my list in case of a transform list and a gameobject list ?

If you understand how a GameObject works, then you know that each one has a transform attached.

If you understand how the Transform component works, then you know that each one has a position property.

Those are both fairly simple, so I have to assume that you’re struggling with the “list” part of this question? You may want to look up some tutorials on lists, arrays, loops, and so on.

As you go through the list, you’ll need some way to recognize or find the particular GameObject(s) that you’re looking for. You didn’t mention what you’re trying to do, so I can’t really advise you beyond that.

I’ts working now with the code i wrote ^^ i did something else wrong. So sorry for this question.

List testlist = new List();

  Update();
{    
    if(blub)
{
Gameobject obj=(Gameobject)Instantiate(obj_prefab,transform.position,Quaternion.identity);

testlist.Add(obj.transform); // so im adding the transform of this object to my list

blub=false
}   
    if (testlist.Count > 0)
    {
        testlist.Insert(0, testlist.Last());            //bring members in right order
       testlist.RemoveAt(testlist.Count - 1);
    }
}

Now i wanna have the coordinates of my gameobject at index0 for example, so i tried:

Update()
{
    Vector 2 pos;
    testlist[0].transform.position = pos;
}