Saving and Loading Game Data in Unity3D

Learn how to implement 5 different ways of saving and loading your game data.
4.2 (42 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
1,312 students enrolled
73% off
Take This Course
  • Lectures 6
  • Length 1 hour
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works


Find online courses made by experts from around the world.


Take your courses with you and learn anywhere, anytime.


Learn and practice real-world skills and achieve your goals.

About This Course

Published 3/2016 English

Course Description

This course is designed to help the hobbyist game developer save and load game data between game sessions. This course shows you 5 different ways to manage your game data locally. It covers PlayerPrefs, Text File, Binary Serialization, XML Serialization and SQLite.

This course has been designed to give you the most value in the shortest amount of time. There is no need to sit through hours and hours of boring videos or hours and hours of scrolling websites, looking for the right way to save your data. We've already done the hard work and packed it all into a nice little course for you.

We have structured the course so that you first look at a few key points to a specific data handling method, then we get into the demonstration and explanation and finally a test at the end. Each test incorporates the contents of what you learned in that data handling method.

If you're expecting to finish this course and be as good as Mr. Miyagi from the Karate kid, then maybe this course isn't for you. In saying that though, you will have an overall understanding of the different ways to persist your data between game sessions. You will also obtain a few scripts, which can easily be deconstructed and used in your own game.

I look forward to seeing you soon!

What are the requirements?

  • You must have downloaded and installed Unity3D and a script editor.
  • You should be familiar with Unity3D and C#. Beginner level with basic programming knowledge is completely fine.
  • You must have an SQLite database editor. I will be demonstrating everything with DB Browser for SQLite, which is free to download.

What am I going to get from this course?

  • Save and load data using PlayerPrefs
  • Save and load data using a Text file and string manipulation
  • Save and load data using Binary Serialization
  • Save and load data using XML Serialization
  • Save and load data using SQLite

Who is the target audience?

  • This course is for anyone with at least basic programming experience and knowledge of Unity3D
  • This course is for anyone who wants to know how to save and load their game data
  • This course is for anyone who wants to learn 5 different methods to save and load game data in 1 hour
  • This course is NOT for you if you want to know which methods work for the different platforms
  • This course is NOT for you if you think you'll be an expert on saving and loading game data after this course
  • This course if NOT for you if you already know how to save and load data using normal C# methods (Text file, Xml, Binary, Sqlite)

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.


Section 1: Introduction

This is a brief introduction and overview of the course content. By the end of this video, you will have a brief overview of what to and not to expect from this course. If you're watching this video after signing up to the course then I wish you good luck for the rest and have fun! I would also love to hear of your very own implementations using the methods outlined throughout this course.

Section 2: PlayerPrefs

In this lesson we cover one of the most basic way to persist data between game sessions. PlayerPrefs is a Unity3D specific data handling method that is extremely simple to use. By the end of this video, you will know a few key points to using PlayerPrefs when handling your games' data, as well as how to do the actual saving and loading.

4 questions

Test your knowledge of the PlayerPrefs Example video tutorial.

Section 3: Textfile

In this lesson we look at a customizable way of storing your game data using text files. We cover the basics of string manipulation and creating your own format for saving and loading data in a text file. By the end of this lesson you will have a basic data handling method to save and load your games data between game sessions.

4 questions

A small test on what you learned in the Textfile lesson.

Section 4: Binary Serialization

In this lesson we cover our first serialization topic, binary serialization. Binary serialization is a very common way to persist your data as it provides a decent amount of security. By the end of this lesson you will understand how to save and load your custom data using binary serialization. The content in the video is designed to be type specific as opposed to the XML tutorial where I introduce generics. As the video is type specific, I have included the same method implemented with generics as a downloadable resource for you. I recommend you watch the XML serialization tutorial prior to downloading the generic implementation, so you understand what is happening.

4 questions

A small test on what you learned in the Binary Serialization tutorial.

Section 5: XML Serialization

In this lesson we look at one of the most favoured ways of persisting data. To implement XML Serialization is very similar to the Binary Serialization tutorial, however, I introduce you to generics. Generics allow us to determine, which type of object gets parsed in and returned from the methods. Generics are a flexible way of writing your code and allow for easy code re-use, as well as improving performance. At the end of this lesson, you will have a basic understanding of the most used XML formats, as well as a generic script to save and load your custom data types.

4 questions

This basic test contains questions about the XML Serialization tutorial.

Section 6: SQLite

In this lesson we cover a more advanced method of persisting your data between game sessions. SQLite is used for manipulating data in databases, and we look at storing and retrieving data using it. This implementation covers SQL queries such as, Update, Insert and Select. More SQL queries are covered in this video, however, those are the main ones. By the end of this lesson you will have a clear and concise method of dealing with data in databases utilizing SQLite. You will also learn how to obtain your own DLL's to use for the project.

4 questions

A basic test on what you learned from the SQLite tutorial.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Dave Savic, Runtime Interactive

Hi I'm Dave. I've been programming for around 10 years now and creating games for around 6. I first started programming by creating macro scripts for a popular online game. I believe that was where my passion for game development and programming came from.

I first started teaching around 3 years ago when I created a few tutorials on Youtube, demonstrating how to make games with Java. I have since moved on from there and I'm now developing tutorials in C# and Unity3D. 

My goal is to provide you with quality content that you can say you've learned at least one thing from. If you honestly didn't learn anything from one of my courses, or you weren't satisfied with the content, then please whack that refund button!

I look forward to seeing you on my courses!

Ready to start learning?
Take This Course