Using latest Godot 4.5.1
I have a scene with an AnimatedSprite2D, and whenever it’s instantiated and added to the node tree the engine fires like 10 of these errors. They don’t seem to affect anything.
Clicking on the error sends me to the script that adds the node. Here’s its code:
extends Control
var files = preload("res://scenes/files.tscn")
var cctv = preload("res://scenes/cctv.tscn")
var files_inst
var cctv_inst
var tab: StringName
func _ready() -> void:
files_inst = files.instantiate()
cctv_inst = cctv.instantiate()
switch_tab('cctv_tab')
func reinstantiate() -> void:
files_inst = files.instantiate()
cctv_inst = cctv.instantiate()
func _on_files_button_pressed() -> void:
switch_tab('files_tab')
func _on_cctv_button_pressed() -> void:
switch_tab('cctv_tab')
func switch_tab(tab_):
if tab_ == 'cctv_tab':
if tab != 'cctv_tab':
$Node2D.add_child(cctv_inst)
reinstantiate()
tab = 'cctv_tab'
if $Node2D.get_node_or_null('files') != null:
$Node2D.get_node('files').queue_free()
elif tab_ == 'files_tab':
if tab != 'files_tab':
$Node2D.add_child(files_inst)
reinstantiate()
tab = 'files_tab'
if $Node2D.get_node_or_null('cctv') != null:
$Node2D.get_node('cctv').queue_free()
func _on_close_button_pressed() -> void:
queue_free()


