- Home /
Combine Mesh but Keep UV Offset & Scale
I am using the example Combine mesh code in C# Link
I have a texture atlas I made in photoshop it is an 8x8 grid.
I have a 40+ GameObjects that all use the same materiel and texture but have a different UV Offset and UV Scale "bits of the atlas".
The GameObjects are all planes "4 Verts".
I want to combine them at Runtime into one mesh using the code example.
My problem is that the combined mesh does not keep the UV Offset or UV Scale, each mesh is added to the "combine" with its default UV. This results in each plane showing the whole atlas.
Q. How can I set the UV of each mesh to the correct size so that the combined mesh shows the correct part of the atlas on each quad of the combined mesh?
Thank you.
that seems strange .... you'd think that the popular Combine$$anonymous$$esh script would in fact keep the mapping correct ??
Yea, I got a work around working AT$$anonymous$$ that involves setting the uv's for each plane rather than using the uv offset and scale. but its not ideal and looks really ugly.