What I am attempting to do for about 2 days is importing a mesh in runtime with this: http://wiki.unity3d.com/index.php?title=ObjImporter
In total I found 3 importers, one that I must pay for, one that was probably a modified version of the importer above, and the one I have right now.
to import it I do:
ObjImporter objImporter = new ObjImporter();
Holder.ModelMesh = objImporter.ImportFile("./file.obj");
sadly, I get this error:
IndexOutOfRangeException: Array index is out of range.
ObjImporter.populateMeshStruct (.meshStruct& mesh) (at Assets/OBJReader/ObjImporter.cs:218)
ObjImporter.ImportFile (System.String filePath) (at Assets/OBJReader/ObjImporter.cs:33)
Which points at:
temp.z = System.Convert.ToInt32(brokenBrokenString[2]);
And I totally have no idea why it is doing that... I don't know how to fix it since I did not write that script, so I ask for some help on why it won't work as intended.
Additional information: The file I try to load can be found, as I can change the name to "file.b" in the script and it tells me it cannot be loaded, while when I put .obj it tells no error on that side. I also tried with 2 other files that also failed.
edit I also tried commenting out that line, and had weird results: the model was there but I had some weird shape following my camera for no reason...