- Home /
Duplicating meshes without instantiating?
I'm making a randomly generated terrain made out of cubes. I need to know how to duplicate a grass block (witch is a prefab) to a new position. Is there a way around making something like this without using instantiate?
Answer by Eric5h5 · Apr 01, 2012 at 12:57 AM
The point of Instantiate is that it creates duplicates; why would you not want to use it to duplicate things? Although creating a cube terrain by making lots of individual objects won't work, since it will be far too slow and use up far too much RAM. Have a look at various Unity Minecraft clone scripts for how to actually do it (namely, by creating meshes).
Answer by alwynd · Oct 15, 2013 at 04:24 PM
You could maybe parent the mesh to a gameobject, clone the parent/gameobject, and then when you translate/rotate that block, it should instance the mesh, meaning there should not be any duplication of geometry, Unity should use hardware instancing in this case, as you are still referencing the same mesh, and asking the GPU to instance it, any transformations done, should be the only extra information. if that makes sense.