Nodes VS. Resources

Today I learned to use resources. After I realized how useful they were, I had an “I understand it now,” moment. But shortly after, I completely forgot what the point of them are and why use them over nodes, kinda like forgetting a dream after waking up.

Right now i’m imagining them as scripts but if they were more tangible? Like a node if instead of attaching a script, you “merge” it.
I also think they are useful cuz they don’t need to be in a scene unlike nodes, but I’m not even sure that’s true :stuck_out_tongue:

My brain hurts, help.

Basically, resources are data containers used to store data for Nodes to use.

For example, if you want to persist the health, ammo, and coins values of your player when you change scenes, or when you close ans open the game again. you can have a resource called player_data that stores these details. The stored resource is basically a text file you can edit yourself.

Once the player is loaded in a scene, to persist the data, just load the resource and get your values.

I hope this helps.

1 Like