I'm writing an editor script in which I want to make a duplicate of a mesh at some point, which I do by calling MeshFilter.mesh().
But stupidly enough, this causes Unity to write the useless error:> Instantiating mesh due to calling MeshFilter.mesh during edit mode. This will leak meshes. Please use MeshFilter.sharedMesh instead.
I say useless because this isn't an error at all, in fact it isn't even an issue, I know what I'm doing and I'm not leaking meshes, I just want to create a single duplicate.
Why did Unity make it like this? Honestly baffling.
So I was wondering, is there any way I can suppress this error?
Or do I really have to manually make a copy of the mesh just to avoid getting this stupid error message?
↧