- Home /
Question by
pixoloco · Oct 02, 2011 at 11:20 PM ·
instantiatelightmapsdrawmesh
how to keep unity lightmaps when using Graphics.DrawMesh ?
Hi, I need to duplicate lots of objects at runtime (some kind of 3d tiles). I first tried with gameobjects but bad idea. So i come up with the Graphis.DrawMesh solution. I have an array of gameobjects in which i plug my base objects and when i have to instantiate, i take the mesh , material and rotation from the gameobject and i use drawmesh in the update loop. It's way faster but i have one big problem : the lightmaps i computed for my objects in unity are not visible anymore. (It was when i was instantiating gameobjects ) So is there a way to keep the lightmap when you drawmesh from a gameobject ? I'd rather keep the atlas uvs created in unity if possible.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612233453im_/https://answers.unity.com/themes/thub/images/avi.jpg)