how to apply a material in code unity code example Example: c# change material in code currentObject.GetComponent<Renderer>().material = materialToAssign;