- Home /
Issue was there was a duplicate resource with the same name buried within the program structure which was conflicting with the imported one.
Cloned object has not materials/textures
Hi,
I am using the Runtime OBJ Importer to load a set of OBJ files at runtime. This imports the models complete with textures with out any issues for the initial loading of each model. However when I go to clone the object using GameObject.Instantiate() the materials/textures disappear. The GameObject mesh hierarchy is preserved and all meshes are being copied, but it is just a bare white model. This is the general pattern of code used:
// yields obj with textures
GameObject importObject = new OBJLoader().Load(modelPath);
// yields obj with no textures
GameObject cloneObject = GameObject.Instantiate(importObject) as GameObject;
It is a requirement of the project that we only load each unique model once only and then clone similar objects from this at runtime. How can we clone the object with all its materials and textures and not just the meshes? Thanks.
Follow this Question
Related Questions
How to set render of imported model to "Mobile" via script (for Android use)? 2 Answers
How to solve a Unity fatal error? 1 Answer
Texture and material not showing up 2 Answers
Importing an obj from magica voxel into unity looks so shiny and glossy... 0 Answers
Missing Component Exception Error 3 Answers