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

how many prefab there is in a scene?

Discussion in 'Editor & General Support' started by sirblundes, Jun 15, 2014.

  1. sirblundes

    sirblundes

    Joined:
    Apr 19, 2014
    Posts:
    18
    hi i need to know how many prefab there is in the scene, ex. how many prefab of the prefab "miao"?
     
  2. chrisall76

    chrisall76

    Joined:
    May 19, 2012
    Posts:
    667
    No clue what your question is here exactly...
     
  3. KheltonHeadley

    KheltonHeadley

    Joined:
    Oct 19, 2010
    Posts:
    1,685
    That doesn't make sense, please rephrase the question.
     
    Deleted User likes this.
  4. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    226
    My guess is that this user wants to know how many instances of a given prefab there are in a scene. One easy way to do it is to give each prefab a unique Tag and then write a small script that uses GameObject.FindGameObjectsWithTag() to count how many instances of it are in the scene.
     
    sirblundes likes this.
  5. sirblundes

    sirblundes

    Joined:
    Apr 19, 2014
    Posts:
    18
    ty :)