Quantcast
Channel: Questions in topic: "obj"
Viewing all articles
Browse latest Browse all 167

Cloned object has not materials/textures

$
0
0
Hi, I am using the [Runtime OBJ Importer][1] 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. [1]: https://assetstore.unity.com/packages/tools/modeling/runtime-obj-importer-49547

Viewing all articles
Browse latest Browse all 167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>