system
1
How do I get the Mesh Filter name from instance?
I got this code:
var instance : GameObject = Instantiate(Resources.Load(targetModel)) as GameObject;
And I would like to print the name of the mesh filter in the debug log:
Debug.Log( something be here? );
The mesh filter name is the same name as the game object:
Debug.Log(instance.name);
If you want to find the name of the mesh the mesh filter is using:
var meshFilter = instance.GetComponent.<MeshFilter>();
var mesh = meshFilter.sharedMesh;
Debug.Log(mesh.name);