Hi ,
I would like to ask what is more efficient : to count tags ( GameObject.FindGameObjectsWithTag ) or count the children ( transform.childCount) For example, I have one parent with many children on it?
Thanks,
Augustas
Hi ,
I would like to ask what is more efficient : to count tags ( GameObject.FindGameObjectsWithTag ) or count the children ( transform.childCount) For example, I have one parent with many children on it?
Thanks,
Augustas
Bump.
Could anyone with pro profiler check the performance of them? Which is more efficient to count children or to count tags?
![]()
Thanks.
Augustas
FindGameObjectsWithTag is more efficient, but will find all game objects that have that tag. The problem with that is if you don’t have all of those objects parented to the same object, then you will still have to cycle through them and get specific objects.
So cycling is more efficient if your tagged objects are not always connected to the same parent.
Layered objects connected to the same parent is actually more effiencent than tags. String comparing is slower than integer comparing.