Hi,
for this you should use tags to improve performances, as Unity search system by name within a scene is not optimal.
then, your flags are likely, hopefully organized already with each of your flags sharing a common parent, do the find using "Get Next child" within this parent.
What I would do is run this routine once when the scene starts and save each of these flags inside an array. Once you have all your flags in the array, you can delete them or maintain in index of the current pending flag or another array of the same lengths with information about each flag ( for example a bool, to know if that flag at index i was taken or not).
Bye,
Jean
Bye,
Jean