# Why is my Mesh reference being marked (Clone) after I add a new component?

I have a script that creates a quad mesh, saves the mesh as an asset, and assembles a game object based on some parameters. If I add another component to the GameObject after, the mesh is marked "(Clone)".

gif for reference. This all happens in code but results are the same when doing it manually.

## -

When I drag the object to the project view to make it a prefab, the Mesh Filter loses it's Mesh reference. It's fine if I manually assign the mesh afterwards but that defeats the purpose of doing it this way. To be clear, if I don't add this (or any) component, it works fine and can be made into a prefab without issue.

• Are you actually adjusting the UV data in the mesh? Sep 9 '17 at 17:16
• I am actually. I thought I had ruled that out as not being the issue but I was wrong.
– liam
Sep 9 '17 at 17:18
• If you're just adjusting the uv mapping in the shader it's fine. But once you start messing with the actual vertex buffer, you most likely are making a clone in script to preserve the original. If you adjust the original all instances will be adjusted. Sep 9 '17 at 17:29

GetComponent<MeshFilter>().mesh

As with renderer.material, accessing this getter creates a local copy of the asset, so any changes you make will be local to this instance and not spill over into other instances using the asset, or your asset source file itself.
If you want to access the original, uncopied mesh, then you'd use the .sharedMesh getter instead.