Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | JulioYagami |
What happens to the resources when they are loaded in different places in my game? Are they duplicated in the memory or they are loaded once?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | JulioYagami |
What happens to the resources when they are loaded in different places in my game? Are they duplicated in the memory or they are loaded once?
Reply From: | Zylann |
They are loaded once. Multiple calls to load
using the same resource path will always return the same resource.
Eventually, if at any point, no variable references that resource, it will be unloaded, and if some code uses load
, it will be loaded again.
Reply From: | Xrayez |
You can also make a resource local_to_scene
so that instancing will force to duplicate the resource so it’s not shared between nodes.