For my current project, I’ve implemented a mechanism that causes objects to glow when the player looks at them. It works fine in the editor, but not in the build. The image on the left shows the object in the editor, and the other image shows it in the build.
The glow happens through a script, the key parts of which are below:
void Highlight()
{
visibleObject.material.EnableKeyword("_EMISSION");
visibleObject.material.SetColor("_EmissionColor", Color.white * 0.2f);
}
void StopHighlight()
{
visibleObject.material.DisableKeyword("_EMISSION");
visibleObject.material.SetColor("_EmissionColor", Color.clear);
}
After searching the forums and elsewhere, I’ve tried changing the quality settings and editing/disabling the directional light in the scene, but this hasn’t worked.