Hello everyone, I’m trying to destroy the first gameobject in a list of gameobjects once it hits a certain size. I cannot for the life of me figure out how to return the game object to destroy.
This is what i have so far:
if(floors.Count >= 9)
{
Destroy(METHOD);
floors.RemoveAt(0);
}
floors is the name of the list. I’m trying to destroy the first gameobject in that list, but i dont know what method to use. I’ve tried the ‘First()’ method, but apparently that doesnt work in unity. Also i looked over the MSDN documentation with no luck. If someone could help me out, i would greatly appreciate it. Thanks.