- Home /
Question by
cly4auHo · Oct 21, 2019 at 12:57 AM ·
findfindgameobjectswithtagfind-gameobject
Find All FindObjectOfType()
how to find all GameObject (same).
FindObjectOfType() - it`s good work if u need only one GameObject with this Script. But how it`s work if on the scene u have a lot of (from prefab)? It is possible to create an array or list like a var[] = FindObjectOfType() ?
Comment
Answer by Bunny83 · Oct 21, 2019 at 02:23 AM
Just use the plural: FindObjectsOfType
i checked it.. it works SmoothFollow[] arr = FindObjectsOfType(); print(arr.Length);