godot 4
extends CanvasLayer
const stondo = preload("res://sample map/map/stondo.tscn")
const bacoor = preload("res://sample map/map/bacoor.tscn")
func _ready():
get_node("TextureRect").hide()
get_node("Label").hide()
func ChangeMap(stage_path):
get_node("TextureRect").show()
get_node("Label").show()
get_node("anim").play("TransIn")
await get_node("anim").animation_finished
var stage = stage_path.instantiate()
get_tree().get_root().get_child(1).free()
get_tree().get_root().get_child(stage)
get_node("anim").play("TransOut")
await get_node("anim").animation_finished
get_node("TextureRect").hide()
im stuck in ((attemp to call function hide in base null instance on a null instance) please help me