Search Unity

How to Instantiate prefab in specified scene?

Discussion in 'Getting Started' started by tlpdx, Sep 19, 2018.

  1. tlpdx

    tlpdx

    Joined:
    Apr 19, 2018
    Posts:
    1
    My English is not good,sorry for that
    I have multiple scenes at the same time.
    I want to Instantiate prefab in the specified scene.
    Now it's only appears on the top.

    I have a manager scene for managing other scenes, and a level scene is loaded with SceneManager.LoadScene() , both scenes exist at the same time.
    The script in the level scene instantiates a prefab with Instantiate() and finds that the instantiated object appears in the manager scene!

    I can only temporarily move it to the level scene with SceneManager.MoveGameObjectToScene() .

    Is there a way to specify an instantiated scene for the prefab?

    What shall I do?
     
    Last edited: Sep 19, 2018