Saving Data - Saving Between Scenes: Make a game like Zelda using Unity and C#

preview_player
Показать описание


Magic bar and Powerup Sprites:

Bow and Arrow Sprites:

Ogre Sprite:

Ryan Hipple's talk:

Richard "Superpig" Fine's talk:

About Me!

Рекомендации по теме
Комментарии
Автор

Great and easy to follow as always,


just a little thing: the string.Format("/{0}", i) part has a syntactic sugar version if you're using the .net 4.x Scripting Runtime/Backend, which i think you are already (and the 3.5 one is marked deprecated in 2019 versions anyway), you can just write $"/{i}" that makes string formating so much easier overall to use and read later on.


especially if you have more variables you want to use and build your string from, for example lets say you have a Name, Surname, Street and City you can now write $"{Surname}, {Name} lives in {Street} in {City}" instead of string.Format("{0}, {1} lives in {2} in {3}", Surname, Name, Street, City).

Pugsly
Автор

Wait, why does your GameSaveManager only have the List?

What happened to the Awake from last part?

roostermaind
Автор

It doesn't get any better than this :) Thank you so much!

lhorbrum
Автор

I will definitely have to come back when i come to finishing my game.

marino
Автор

Hey! I realize this is quite an old video, but I was wondering whether you ever ended up including how to create the front-end for this saving system in one of the tutorials? As the next one only shows how to make a Debug-Button to delete all Saved Data, but not how to properly save/load different save slots? As in, having the option to chose a new game or load an existent save from the main menu. Did you ever end up showing something like that in any tutorial? Thanks in advance!

tee
Автор

thank you for making these videos. you are

thegameblock
Автор

What happened to the don't destroy on load stuff?

somerandom
Автор

Not sure why I didn't think to save the SO's directly. I guess it's already a serializable data.
Felt like i had to have some class holding the data.

micaiahstevens
Автор

When and what episode did the boolValue created?

Rdp
Автор

Please help me!!


Okay so a bit has changed in Unity, at least for me, regarding scriptable objects. Firstly, Unity now saves the scriptable object perfectly fine without resetting it. Even after closing Unity.

So here's my situation. Saving the data with your code works perfectly fine. It saves, I can exit play mode, and it will persist, even without me having to do anything, or even clicking the save button (from your next video in the series). the problem is i don't want constant auto saving of Scriptable Objects.

For example, If I open a treasure chest and have a bool value set it to open so it persists, it works even after I exit play mode, close unity all that. But when everything auto-saves like this, it doesn't give me control over when saving happens. If i save before i open a treasure chest, then open it, then use your function to load the previous save, the treasure chest is still open even though it shouldn't be. The Bool Value persists even though I SHOULD be overwriting the file saved to the disk.


The only thing that fixes it is using a debug button (like the next video in your series) but I have to manually go through all my scriptable objects and reset the variables myself. deleting the file doesn't work. And that sucks if I add more stuff in the future that I want to save.


I think something has changed about how scriptable objects save and persist in a Unity update since this video came out and now these functions don't work since scriptable objects already persist. Honestly, ANY help would be useful.

SuddenlySlanted
Автор

Is anyone still following? I tried this code and it works perfectly in editor until I tried it on pc build. Save not working at all.

Yukaraoke
Автор

Question: how do I reset the scene now? Whenever I enter it, my chests are open.

toxiconflict
Автор

Could you update your GitHub. I know that you are planning to reboot your github but this will take a lot of time so can you update your old one. One last time

illyuziyaillyuziya
Автор

This was my biggest fear, balls deep into my project and i found this issue. I just don't understand it. Why does Unity destroy my data and break my game when it loads a new scene? why are we forced to do this kind of crap to work around what is obviously a completely stupid SceneManagement system. this dontDestroyonload just carries my gameobjects around from scene to scene! not what i want! i am so frustrated i want to delete the whole project and find a different hobby to learn

daryll