Below are some code wich instanciates a model. Now I want the models material name to be printed in the Debug.Log. Ive tried a bit with instance.GetComponent but cant get it to work.
Anyone know the solution?
var instance : GameObject = Instantiate(Resources.Load(targetModel)) as GameObject;
Debug.Log(???);
One thing thou, Currently it prints out: “red (instance)” in the debug log. Is it possible to somehow only get the name: “red”. Or how do I remove “(instance)” from the string?