Color does not change when using a signal

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By VLAHIN

If I use the color change function at startup, everything works. And if I send a signal that should do this function, it does it, but the color does not change.

Here is my code. (This object is prefab)

extends Spatial


onready var tween := $Tween
var colors:Array = [Color.white, Color.red, Color.orange, Color.green, Color.aqua, Color.blueviolet]
var stat:int = 0
var is_merge:bool = false



func _ready():
	$"..".connect("spawn", self, "_on_Bomb_spawn")
	$"..".connect("set_color", self, "_set_color")
	tween.interpolate_property($".", "translation:y", 2, 1.4, 0.2)
	set_color()


func set_color() -> void:
	$BombMesh.get_surface_material(0).albedo_color = colors[stat]
	


func _set_color() -> void:
	set_color()
:bust_in_silhouette: Reply From: VLAHIN

I myself solved this problem by typing. You need to check the box here.