Clearing duplicated resources from memory when done

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

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'])
:bust_in_silhouette: Reply From: grymjack

rossunger actually helped me answer this in a different post. Thank you for the help.

External hard drives, such as Time Machine backups, are frequently used for backup purposes. They can also be used to move files from one computer to another. uno online

Rinstall | 2022-12-19 10:09