- Home /
Importing Object working in Unity editor, error when running build project
I am trying to import a .obj file into my unity project at runtime. I used the framework SimpleOBJ to import this file.
When running the project inside of the Unity editor everything works as expected and the object gets imported and displayed.
However after building the project when I try to import the file I get an error and the .obj file does not get imported.
I've tried different methodes of importing, more closely resembeling the examples delevered with the framework, however this only complicated the code but did not fix my issue.
it seems like a shader issue, however when looking for problems like this i couldn't quite find anything that might help.
class ObjHandler : MonoBehaviour
{
public GameObject import()
{
filepath = FileBrowser.OpenSingleFile("*");
WWW www = new WWW(filepath);
return ObjImporter.Import(www.text);
}
}
public void ImportObject()
{
ObjHandler handler = new ObjHandler();
_gameObject = handler.Import();
foreach (Transform child in _gameObject.transform)
{
GameObjects.Add(new GameObjectModel(child.gameObject));
Debug.Log(child.gameObject.name);
}
}
Expected Result: https://i.imgur.com/0o0iyf6.png
Actual result (Error): https://i.imgur.com/yMtesoh.png
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Importing large amounts of data 0 Answers
Custom Export and Import FBX Data 1 Answer
Connect matlab and unity 0 Answers