Mesh Filter Bug?

…well, this is weird?

When checking the MeshFilter mesh it assigns an unknown mesh, why is this happening?
You can apply this chunk to an empty gameobject that contains a MeshFilter to see this happening, just press play.

    void Update(){
        if (GetComponent<MeshFilter>().mesh) {
            //Do some stuff
        }
    }

Accessing the mesh property creates a new instantiation of the mesh so that the original that all scene objects use does not get altered, use sharedMesh if all you want to do is read from the mesh.

1 Like

haha, thanks…I’m a clown, I totally forgot about that
thanks for the link my friend