Search Unity

Certain GameObjects only appear on Hierarchy after build

Discussion in 'Editor & General Support' started by charu_, Nov 3, 2020.

  1. charu_

    charu_

    Joined:
    Jan 16, 2020
    Posts:
    9
    So there are gameobjects in my hierarchy, but when I press play more gameobjects appear which I am not able to modify when I stop which I wish to do. Is this the work of a script or a plugin? Thanks!
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
    Definitely. Probably a script.

    That behavior matches what happens if you create any GameObjects with Instantiate in one of your scripts at runtime. What kind of object is it? It seems strange to me that you're not aware of the source of these objects, as most likely you would have added it yourself.
     
    smock_74 and DiegoDePalacio like this.
  3. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Hi @charu_,

    As @PraetorBlue mentioned, this is happening when a call to the
    Instantiate
    method is called.

    You can find more information about such a method here: https://docs.unity3d.com/ScriptReference/Object.Instantiate.html

    What you can do is to search inside of the IDE (script editor) that you're using where
    Instantiate
    is being called on the project scrpits and set breakpoints to find which one is being called.

    After finding the right place in the code, you can then modify your gameObjects there or in a different script to fit your needs.


    I hope this helps!
     
    PraetorBlue and smock_74 like this.
  4. charu_

    charu_

    Joined:
    Jan 16, 2020
    Posts:
    9
    Thank you very much!
     
    DiegoDePalacio likes this.