How To Save And Load Your Game Data With Scriptable Objects - Unity

  Рет қаралды 37,101

Dapper Dino

Dapper Dino

5 жыл бұрын

Help to support the channel if you are feeling super kind: / dapperdino
Join our Discord: / discord
• Unite Austin 2017 - Ga...
• Unite 2016 - Overthrow...
In this video I show you how to save and load your game data in Unity with scriptable objects.
-----------------------------------------------------------------------------------------------------------
If you liked the video then please respond with a like and a subscribe to show your support for the channel and I'll repay you by creating more tutorials to teach you the wonder that is Unity :D

Пікірлер: 59
@bleblekime1815
@bleblekime1815 4 жыл бұрын
I've just realized something interesting: if you save this as a txt and try to open it in Sublime Text, it will show up hexadecimal code. However, if you use notepad, you will be actually able to see values and edit them. EDIT: Turns out you actually cant serialize scriptable objects. Even if you are will open sublime text or vs and see hexadecimal code, by opening you save the file by notepad you will be able to see and edit values. What you have to do is to create another object that is a pure c# class and load your scriptable object data to it. After that, you can serialize it and it should work properly.
@kapkoder4009
@kapkoder4009 3 жыл бұрын
THANK YOU SOOO MUCH!!!! IVE BEEN LOOKING EVERWHERE FOR THIS!
@kapkoder4009
@kapkoder4009 3 жыл бұрын
@Skippy_xD don't tell anyone I watch tutorials
@sherlyhudson2198
@sherlyhudson2198 5 жыл бұрын
Can you do a tutorial on inventory system that you can save and load? Saving string, int and float seem simple enough, but when it comes to inventory I have no idea how to implement it because there are images and slots etc.
@sus7820
@sus7820 3 жыл бұрын
Hey you still alive??
@brendaschmidt3028
@brendaschmidt3028 4 жыл бұрын
My big question was if it would save a private field if it had the [SerializeField] notation. Just for others who might be wondering - it does. So you don't have to have your fields set as public. You can have serialized private fields.
@DustVoltrage
@DustVoltrage 4 жыл бұрын
Even if's a really good one, I have to say there are millions of these tutorial out there. What the community would really need is the more complexe situations : saving derived class from scriptable objects, non serializable stuff such as sprites and so on ! Please Dino
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
I'll do a more in-depth example next week that is more practical for bigger games :)
@DustVoltrage
@DustVoltrage 4 жыл бұрын
@@DapperDinoCodingTutorials awesome news !! 🙏
@ozeistudio6916
@ozeistudio6916 4 жыл бұрын
@@DapperDinoCodingTutorials am at 3jin but is this working with mobile ?
@oGSS52o
@oGSS52o 4 жыл бұрын
@@DapperDinoCodingTutorials Still planned ?
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
I really need to make a public schedule so people can see what I'm planning with upcoming videos :p I will be doing a video today and tomorrow for Unity ML agents since they just came out of preview a week ago then I can do a video on more complex saving next week.
@jamiebates5522
@jamiebates5522 5 жыл бұрын
RIP Bob, overwritten by Bill in his prime :P I guess if you wanted the filename to be a bit more mysterious than 'slot1.save', you could create some kind of hash using the filename and then use the hash as a filename instead. Very informatative, thanks for the video!
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 5 жыл бұрын
Yep, it's really up to you for deciding how secure you need or want it to be. I'm glad you liked the video :D
@duskjk1258
@duskjk1258 2 жыл бұрын
You are amazing. I have been looking for a method like this in which c# that how can I save whole class object data in a file. This json code is perfect. Thank you!
@michaeldiaz4285
@michaeldiaz4285 Жыл бұрын
this tutorial was lit and str8 up to the point
@dlxinteractive
@dlxinteractive 4 жыл бұрын
17:49 how come when i saved my script to PlayerPrefs and open up the text file that stores my script it displays it in JSON but not in hexadecimal? it displays this: ÿÿÿÿ |{"startingHealth":20.0,"health":20.0,"moveSpeed":9.0,"crosshairs":{"instanceID":1009186},"deathEffect":{"instanceID":27244}} (yes this is the player script).
@ImmortalityYT
@ImmortalityYT 5 жыл бұрын
Thanks by far the best tutorial I've seen on the topic! This is a dumb question but is character a class?
@jesse578
@jesse578 5 жыл бұрын
LOL no answer
@ItsCodeRedYT
@ItsCodeRedYT 4 жыл бұрын
Yeah I'm pretty sure it is a class.
@my_namejeff9770
@my_namejeff9770 3 жыл бұрын
character is scriptable object
@user-kp4by9cg2e
@user-kp4by9cg2e Жыл бұрын
Thank you, solve my problem!!
@dan-mechanics2014
@dan-mechanics2014 4 жыл бұрын
This is really awsome
@CDJaramillo92
@CDJaramillo92 5 жыл бұрын
I'm trying to save the game and if the game is open again has a button to load a scene but with the current progress. what would I do?
@RonBonomo
@RonBonomo 5 жыл бұрын
I tried this, but it doesn't work if i try to save a list. It wont reload the list. When I am saving I use List items, i will put items int the bracket (json, items). But this doesn't seem to be saving or loading the info in the list. Could you tell me what I am doing wrong, if I am missing a function or something for saving a list that changes as game play goes on
@charlenejoyconcha3502
@charlenejoyconcha3502 3 жыл бұрын
can i save a data without replacing the old data? Can i CRUD this scriptable obj?
@iamgingerbread6558
@iamgingerbread6558 9 ай бұрын
Very Big Wow super Helpful you.Thanks !! xd
@gamingmartian1781
@gamingmartian1781 5 жыл бұрын
how would i do this if i wanted to post it online
@kazimashiatsumaira1684
@kazimashiatsumaira1684 Жыл бұрын
Will this work after we give build, play game, quit application and then reopen application?
@theRealDonaldTrump666
@theRealDonaldTrump666 5 жыл бұрын
thats auto save fast. no more waiting 30 - 50 seconds to save because i have 50 values that need to be individually sent through the pipeline. a few times in the past i wasnt sure if unity crashed or if it was doing it. i couldnt click on anything
@reshinarutv
@reshinarutv Жыл бұрын
is it better if you use playerprefs?
@dannykessel6634
@dannykessel6634 5 жыл бұрын
It worked when I was still building (and testing it) in Unity. But after the Build, the safe doesn't work anymore. What could this possibly be?
@judgegroovyman
@judgegroovyman 3 жыл бұрын
I know it’s been a long time but as I understand it scriptable objects can’t be written to in a build. Has anyone found out otherwise?
@apurvasurve3294
@apurvasurve3294 4 жыл бұрын
@DapperDino what is application in application.persistentdatapath where did you create that folder
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
I didn't create it, it's done automatically by unity because different operating systems use different file path structures. It essentially does the hard work for you when it comes to choosing where to put save data on a users device :)
@apurvasurve3294
@apurvasurve3294 4 жыл бұрын
@@DapperDinoCodingTutorials when i add it in my code no option for application comes in suggestions, also it does not turn green
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 4 жыл бұрын
@@apurvasurve3294 It's part of the UnityEngine namespace so it should appear: docs.unity3d.com/ScriptReference/Application-persistentDataPath.html
@alinazari2046
@alinazari2046 4 жыл бұрын
Holy Ricksus , i just saved a ScriptableObject with huge data and reloaded it on Android O_o
@nemogames5354
@nemogames5354 4 жыл бұрын
I used this method and now im getting a lot of Type mismatch
@Luluskuy
@Luluskuy Жыл бұрын
Hi! Do this work on android? Is the path directory same?
@Zenkoreal
@Zenkoreal 5 жыл бұрын
Can you make a video how to make team bot for discord??? So you can !team create And invite other people (max30)? I actually need it for my discord , but there arent any tutorial
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 5 жыл бұрын
All you would need is a list of members and to add the person to the list when they use the command. As we are currently building our branding and website/server with the channel we will be creating and selling specific, fully functional bots on our website, such as a scrim bots and so on due to the fact that we currently have no form of income and it costs us to do all of this.
@Zenkoreal
@Zenkoreal 5 жыл бұрын
Dapper Dino - Coding Tutorials ok but i know nothing in coding so im trying to look for someone can made it or a tutorial
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 5 жыл бұрын
As I said, as one of the only possible ways for income we are creating and selling specific bots, either that or you start learning some basic coding because we don't just give out code for people to copy. We are here to teach :p
@Zenkoreal
@Zenkoreal 5 жыл бұрын
Oh ok , thanks
@Zenkoreal
@Zenkoreal 5 жыл бұрын
How many for this bot?
@angelaaliangan2918
@angelaaliangan2918 5 жыл бұрын
lol public Character is not showing dude . my script got an error
@VoltFall
@VoltFall 3 жыл бұрын
same any solutio- wait oh you have to watch his previous video to see the character
@bobsjobisfob
@bobsjobisfob 2 жыл бұрын
i cant believe this didnt work AND i also had to copy it by hand
@charlenejoyconcha3502
@charlenejoyconcha3502 3 жыл бұрын
Hello guys can you help me. I have multiple accounts, leaderboards, trophy room and assessment record for my toddler game. but unfortunately i dont know how to do it because im a newbie in unity world. Is there any tutorials step by step or can you guys teach me how to do a CRUD step by step? Hope you guys help me.
@arifharsowiyono7242
@arifharsowiyono7242 5 жыл бұрын
you not explain InputManager Script dude :v
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 5 жыл бұрын
Huh?
@Aldin101
@Aldin101 Жыл бұрын
You should uninstall league of legends
@realurah
@realurah Жыл бұрын
thanks dude
Rethink Everything with Scriptable Object VARIABLES
15:28
OMG😳 #tiktok #shorts #potapova_blog
00:58
Potapova_blog
Рет қаралды 3,7 МЛН
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 1,8 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:19
CRAZY GREAPA
Рет қаралды 23 МЛН
ScriptableObjects, Explained | Unity Tutorial
19:27
LlamAcademy
Рет қаралды 10 М.
Saving with Binary Serialization Made Easy [Unity Tutorial]
14:32
Comp-3 Interactive
Рет қаралды 10 М.
Introduction to EasySave
14:43
Hutong Games
Рет қаралды 9 М.
Making a Save & Load System in Unity using JSON
8:53
ChrisDev
Рет қаралды 6 М.
Better Save/Load using Data Binding in Unity
18:47
git-amend
Рет қаралды 10 М.
Unity Save Game System Tutorial | Save Data To JSON
43:53
Dan Pos
Рет қаралды 12 М.
How to make a Save & Load System in Unity | 2022
26:56
Shaped by Rain Studios
Рет қаралды 178 М.
Unity C# Saving and Loading Tutorial
27:25
GameDevHQ
Рет қаралды 26 М.
СОНИК НУБТАН АЛТЫНҒА АЙНАЛДЫ (GTA V)
12:19
Салли PLAY
Рет қаралды 73 М.
Я прожил 100 Дней ЗА ГЛАДИАТОРА в Майнкрафт…
37:07
TumkaGames / Тумка :3
Рет қаралды 760 М.
MEGA BOXES ARE BACK!!!
8:53
Brawl Stars
Рет қаралды 33 МЛН