I have Option Button that contains several items. Changing the current item is connected to a function that performs logic. When I do it by mouse it works as expected. But when I try do it in code (for example, in _ready()
functions, then the signal is not called and logic function is not called:
func _ready() -> void:
$Panel/Button.select(randi() % 4)
I can emit my logic function manually:
func _ready() -> void:
$Panel/Button.select(randi() % 4)
$Panel/Button.emit_signal("item_selected", $Panel/Button.selected)
But is there more convenient way to change control property with emitting signal inside class?