Rock YouTube channel with real views, likes and subscribers
Get Free YouTube Subscribers, Views and Likes

How to make a Save u0026 Load System in Unity | 2022

Follow
Shaped by Rain Studios

In this video, I show how to make a Save and Load system in Unity that will work for any type of game. We'll save the data to a file in both a JSON format as well as an encrypted format which we'll be able to toggle between in the Unity inspector.

IMPORTANT: For WebGL games, because WebGL can't save directly to a file system, a different method of storage than we use in the video needs to be implemented. See the pinned comment for more info on this.

IMPORTANT: Some have mentioned having trouble with Unity versions prior to 2020. I'm not sure on the details, but if you're having issues with the serialization parts of this tutorial, upgrading your Unity version (to 2020 or higher) is something worth trying!

Thank you for watching and I hope the video was helpful!

► FAQ:
I have some of the more frequently asked questions and important information regarding this tutorial in the Pinned Comment; however, more up to date/detailed FAQ's can be found on my Discord server.

► SAVE & LOAD SYSTEM TUTORIAL PLAYLIST
The full Save & Load System tutorial playlist that this video is part of can be found here.
   • How to make a Save & Load System in U...  

► TIMESTAMPS
0:00 Intro
0:35 Save & Load System Design
3:25 Creating initial Game Data
4:26 Stubbing out the Core of the System
6:11 When to Save and Load
6:47 Passing Data to other Scripts
10:14 Reading and Writing to a File
16:10 Adding more Data to be Saved
17:15 Saving Collectables in a Dictionary
20:16 Serializing a Dictionary to JSON
23:00 Encrypting the Data
26:11 Outro

► RESOURCES
Application.PersistentDataPath documentation
https://docs.unity3d.com/ScriptRefere...

ISerializationCallbackReceiver documentation
https://docs.unity3d.com/ScriptRefere...

NewtonSoft JSON.NET for Unity which can be used as an alternative to the method shown in this tutorial for serializing more complex data types to JSON. It can be installed through the package manager.
https://docs.unity3d.com/Packages/com...

► GITHUB PROJECT
The '1startingpoint' branch is the starting point of the project for this tutorial and the '2saveloadimplemented' branch is the end result.
https://github.com/shapedbyrainstudio...

► MUSIC
The backing music is custom made by @themaykit.
  / themaykit  

► DISCORD
Come ask questions, suggest a video topic, or just hang out!
Discord ➔   / discord  

► THE PATH OF REN
Wishlist 'The Path of Ren' on Steam!
Steam (The Path of Ren) ➔ https://store.steampowered.com/app/16...

► SOCIAL MEDIA LINKS
Follow my current project!
Twitter ➔   / trevermock  
Instagram ➔   / trevermock  
TikTok ➔   / shapedbyrainstudios  
Website ➔ https://shapedbyrainstudios.com/

► SUPPORT
Any support is much appreciated! I may receive a commission on any assets purchased using the below Unity Asset Store link.
Unity Asset Store Affiliate Link ➔ https://assetstore.unity.com/?aid=110...
☕ Buy me a coffee! (Kofi) ➔ https://kofi.com/shapedbyrainstudios

#gamedev #unity2d #unity

posted by me10i841