Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Loop through all gameobjects in a scene?

Discussion in 'Scripting' started by Willem, Apr 5, 2007.

  1. Willem

    Willem

    Joined:
    Mar 9, 2007
    Posts:
    184
    I'm sure I did this already but I can't find the code on my machine. How would I loop through all of the gameobjects in the currently loaded scene? I want to find all of the cameras I've placed.
     
  2. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
  3. Willem

    Willem

    Joined:
    Mar 9, 2007
    Posts:
    184
    That was it! Yes, thanks Matthew!