- Home /
Importing models from streamingassets
Hello, I'm using ObjImporter http://wiki.unity3d.com/index.php?title=ObjImporter The following script imports and assigns a mesh to an array of a custom class and then sets the preview gameobject to show the mesh as a preview. However, this works for only 1 of 3 models. Is there an alternative way of importing mesh from local files during runtime?
if (comp[i].mesh == null) comp[i].mesh = ObjImporter.ImportFile(Application.streamingAssetsPath+comp[i].path+"/model.obj");
GameObject.Find("CompPreview").GetComponent<MeshFilter>().mesh = comp[i].mesh;
Comment