Complete the code to set the color of a material to red.
Material mat = GetComponent<Renderer>().material;
mat.color = [1];To set a material's color to red, use Color.red.
Complete the code to change the metallic property of a material to 0.5.
Material mat = GetComponent<Renderer>().material; mat.SetFloat("[1]", 0.5f);
"_Glossiness" which controls smoothness, not metallic.The metallic property is controlled by the shader property named "_Metallic".
Fix the error in the code to correctly set the emission color of a material.
Material mat = GetComponent<Renderer>().material;
mat.[1];emissionColor property directly which does not exist."_Emission".Emission color must be set using SetColor with the property name "_EmissionColor".
Fill both blanks to create a dictionary of material names and their smoothness values for materials with smoothness greater than 0.5.
var smoothMaterials = new Dictionary<string, float> {
{ [1], mat.GetFloat([2]) }
};"_Smoothness" which is not the correct property name.mat.GetName().Use mat.name for the material's name and "_Glossiness" for smoothness property.
Fill all three blanks to create a dictionary comprehension that maps uppercase material names to their emission colors if emission intensity is greater than 0.
var emissionDict = new Dictionary<string, Color> {
{ [1], mat.GetColor([2]) }
where mat.GetFloat([3]) > 0
};mat.color instead of mat.GetColor("_EmissionColor").Use mat.name.ToUpper() for uppercase names, "_EmissionColor" for emission color, and "_EmissionIntensity" for emission intensity check.