Search Unity

EditorUtility.InstantiatePrefab and assets not working ?

Discussion in 'Scripting' started by llavigne, Apr 5, 2010.

  1. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    in a simple Post Processor I want to instantiate the asset while keeping connection and I use

    Code (csharp):
    1.  
    2.     void OnPostprocessModel (GameObject modelRoot)
    3.     {
    4.         GameObject assetInstance = EditorUtility.ReconnectToLastPrefab(assetInstance) as GameObject;
    5.         }
    6.  
    It does not create an instane in the scene.
    GameObject.Instantiate does however work.

    Is there a workaround ?