The code below works fine for displaying a duplicated resource on the screen. The problem comes when I want to clear these resources from the screen (and memory) and display a new set of resources. The old resources are still displaying on the screen along with the new resources. How can I track the duplicated resources and remove them when no longer needed? Thank you
# setting node name and placing resource on screen
temp_node = get_node(location_info.path + location_info.filename)
var my_copy = temp_node.duplicate()
add_child(my_copy)
my_copy.visible = true
my_copy.set_position(Vector2(xpos, ypos))
my_copy.rect_scale = Vector2(asset_result[0]['scale'],asset_result[0]['scale'])