unity set material to default material code example Example: unity set material gameObject.GetComponent<Renderer>().material = newMaterial;