Background color change issue. Bug?

So I am experimenting with a fun little way to change lighting highlights on tiles when in combat. Not the most efficient way but its for a quick and dirty project. Basically leaving holes in my tiles where the highlights go and changing background color from a greenish color to a reddish color. However I am running into a weird issue where if there is more than a single object placed on an instance layer in any room even an unloaded room, through the editor, it doesn't change. If the objects are spawned by another object at runtime it still continues to function properly. I have tried activating the change through different events - alarms, mouse enter, collision, etc - and all have the same issue. Not sure if I'm missing something with how the layer_background_color functions, if backgrounds don't function how I think, or if its a legitimate bug in the engine.

The code for changing the color -

GML:
if(alarmState){
    if(colorMerge<1){
        colorMerge = easeInBounce(colorMergeTime,0,1,maxColorMergeTime);
        var layerID = layer_get_id("LightHighlights");
        var backID = layer_background_get_id(layerID);
        var color = merge_color(stateColors[alarmStates.current],stateColors[alarmStates.alert],colorMerge);
        stateColors[alarmStates.current]= color;
        changeLighting(backID,color);
        colorMergeTime++;
    }
}else{
    if(colorMerge<1){
        colorMerge = easeOutBounce(colorMergeTime,0,1,maxColorMergeTime);
        var layerID = layer_get_id("LightHighlights");
        var backID = layer_background_get_id(layerID);
        var color = merge_color(stateColors[alarmStates.current],stateColors[alarmStates.normal],colorMerge);
        stateColors[alarmStates.current]= color;
        changeLighting(backID,color);
        colorMergeTime++;
    }
}
}
The changeLighting script -

Code:
var background = argument0;
var color = argument1;

layer_background_blend(background,color);
Edit: So I just copied this into another project and it works fine. Not sure why but...
 
Last edited:
Top