Search Unity

move model from asset folder to hierarchy or scene with c#

Discussion in 'Scripting' started by meotony, Dec 21, 2014.

  1. meotony

    meotony

    Joined:
    Dec 1, 2014
    Posts:
    12
    Hello, I use recently Unity. I need help. Through a script I copied a file (a model .3DS) in runtime from a folder on my computer in the Assets folder. Now I should insert the model in the scene and in the panel hierarchy. I know that just do a drag and drop if you are not in runtime, but I need to move in runtime, instantiate the model in the scene through scrip c #. Thanks for your help.
     
  2. darkAbacus247

    darkAbacus247

    Joined:
    Sep 7, 2010
    Posts:
    251
    You can do this using the resources function found here

    Do the note of ALL the documentation, this code will not work unless implemented correctly.