C# Dividing Gameobject List by Half

I want to create a gameobject list that is equal to half of another gameobject list. But I’m not sure how to get it. First thing that came to mind was

gameobjectList2 = gameobjectList/2 

but that doesn’t work since that is using both a gameobject list and an integer. I also tried using a for loop

for(int i=0;i<gameobjectList.Count/2;i++)
gameobjectList2.add(gameobjectList*)* 

but that gives me a list that is multiplied not divided. any idea how I can get gameobjectList2 to equal half of gameobjectList?

Are you saying you have a list of GameObjects and you want a list with just half of those GameObjects in it? If so you could use GetRange…

List<GameObject> gameObjectList2 = gameobjectlist.GetRange(0, gameobjectlist.Count/2);

Your loop method should have worked if gameobjectList2 was empty before the loop. If this doesn’t solve your problem post more of your code for context.