methods for saving variables

This page summarizes the projects mentioned and recommended in the original post on /r/Unity2D

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • guid-based-reference

    A component for giving Game Objects a GUID and a class to create references to objects in any Scene by GUID

  • This has worked for me so far. I have my save data saved in JSON format in a text file. Your gameobjects/player objects need to have unique ID. Unity has a solution to this on their GitHub. If this isn't an online game, have a Savemanager singleton. when the game starts, the Savemanager will read all of the savedata from your text file into memory (dictionary with GUID as key). Each component that needs to save data can implement a Saveable interface. Each component will have a reference to the central gameobject GUID. On awake each component can request to load the specific type of save data it needs from the Savemanager, if none exists the manager will return a new savedata instance for the component. Each component that needs to be saved can also request that they be added to a central list in the Savemanager. When it comes time to save all your data, you can call a Save method on each component in your list that implements the Saveable interface.

  • open-project-1

    Unity Open Project #1: Chop Chop

  • I didn't use any particular tutorial for my save system but Unity actually developed a community based Open Project a year or so ago. Their save system is probably a good reference to get something started. They have a few other systems implemented in that project as well that you might find useful, although personally I didn't love how much they used scriptableobjects for their event system.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts