Categories
Game Creation Mastering Development

Exclude removed objects from list counting?

I want to count the number of objects on my list. But because I remove and add, my script keep count those empty elements. update: This happen when I destroy the object when it inside the collider. This object does not get out from "OnTriggerExit2D". public List<GameObject> Sorts; public List<GameObject> ItemsInside; public int NumSorts, NumItems; […]