I have two CanvasLayer and in the first one I have a ColorRect, below is my scene tree
The ColorRect(Overlay) inside CanvasLayer(CanvasLayer2) has Color property which I am trying to change by writing below code in a script attached to mainscreen node
var tween = get_tree().create_tween()
tween.tween_property($Control/CanvasLayer2/Overlay, "modulate", Color(0, 0, 1, 1), 2).set_trans(Tween.TRANS_LINEAR)
where the default value of ColorRect is (0, 0, 1, 0) , Now this doesn't work and no error is shown but if change the code to
tween.tween_property($Control/CanvasLayer2/Overlay, "modulate", Color(0, 0, 1, 0), 2).set_trans(Tween.TRANS_LINEAR)
and default value of ColorRect to (0, 0, 1, 1) then the ColorRect will slowly fade away as intended, in general I can decrease the value from current value but I cannot increase it, am I using tween incorrectly ? If so is there a better way to do it ? Also please let me the correct way to do it using tween if possible.