Search Unity

How to load a mesh file at runtime

Discussion in 'Getting Started' started by RFM, Mar 20, 2015.

  1. RFM

    RFM

    Joined:
    Mar 20, 2015
    Posts:
    2
    I would like to know if it's possible to load an asset not known at coding time with Unity (could not be in a ressource directory). I'm new to Unity and couldn't found the answer on the web.

    For example my program should have an editable zone and a button, the user will enter a mesh file path (dae file for example) and click the button. The program will clear the scene (not the light and camera), load the mesh, scale the mesh and move the camera to show the new mesh.

    I found example of code building a mesh by calculation, but not just loading a "standard" file. Is there an example somewhere?

    I use the new version 5.0.0p1
     
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Ryiah likes this.
  3. RFM

    RFM

    Joined:
    Mar 20, 2015
    Posts:
    2
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411