Hi guys, so this is my question of the day:
I need to do something based on the material of the object, lets suppose I have 100 planes, each of them has the same material, except one so I need to check on every plane, if it has a different material applied then i will do something, I tried something like this but It just didn’t worked. (I don’t know why)
var diffMaterial: Material; //Material of the bombs
if(gameObject.renderer.material == diffMaterial){
Debug.Log ("This object has a different Material");
//Do stuff
}