-4
\$\begingroup\$

I need to find every object of the same class in the scene. How can I do this?

\$\endgroup\$
  • \$\begingroup\$ Please refrain from filling your question with the same sentence repeated over and over. \$\endgroup\$ – Bálint Dec 16 '17 at 21:26
  • \$\begingroup\$ @JoshPetrie, I do not know what to try and that is the reason I am asking here. lol \$\endgroup\$ – Ярик Троф Dec 17 '17 at 10:20
0
\$\begingroup\$

The easiest way is to get them in an array with something like FindObjectsOfType.

https://docs.unity3d.com/ScriptReference/Object.FindObjectsOfType.html

Are you needing some specific functionality that this doesn't offer?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.