Basic Saving and Loading in Unity with PlayerPrefs
Вставка
- Опубліковано 1 жов 2024
- Playerprefs lets you save strings/floats/ints in key-value pairs, and is nice because it comes right out of the box with Unity without having to import any packages or do any extra work.
However, Playerprefs as a save system is very limited, and is not actually intended to store game data, but rather Player Preferences (hence the name) that you might find in, say, an options/settings menu.
With that said, its useful to know, and is actually an excellent use case for things like GameJams if you want to have a Save system running quickly and it doesn't need to be complex!
PlayerPrefs Documentation: docs.unity3d.c...
✨Want to support the channel?
Buy me a coffee ☕: ko-fi.com/bmoli
SUBSCRIBE to see future videos, including a more comprehensive Save/Load system!
➤LIKE the video if you enjoyed, it really helps the channel!
➤Join our DISCORD SERVER to become a god amongst men: / discord
Thanks for watching!
#bmo #unity #tutorial
We used this tutorial to make our first game "Rebound Out", just released on iOS and Android!
Yay you making it. You explain stuff pretty well sir. Tysm for your videos. I ve learnt a lot last two weeks
Bmo’s blowing up 🔥 Congrats on 10k, well deserved man!
Great teacher, don't stop making these simple tutorials
thanks, looking forward to the follow up
Congrats on 10k! Holy smokes
thanks for the video man, i love your channel, i feel very anxious about completing any game of any size and just watching good tutorials like this make me feel a little bit better, because it's not always about accomplishing but enjoying the ride, and i enjoy your videos
Thanks!
Trash tutorial, just didnt show anything from the project
I will save all my shit with this
good clear!
Thanks for the tutorial. This is quick and easy way.
First comment!!!!!!!!
Oh wow this was awesome
your content is just awesome, keep up the good work
Thanks fast and easy to understand.
Very nice and easy to follow :)
I'm good to use this for keybinds/weapon loadout choices I'd assume right?
Great vid
Understable information
Thanks!
Thank you so much this really helped me in a last minute situation for a game jam! I subscribed and liked
I have a question, how i can use PlayerPrefs to the code under the previous video ?
ua-cam.com/video/kAPIWJJ6NQI/v-deo.html
Clear and concise. Thank you!
Thanks alot really helped me in my project im making it was straight to the point.
sir, can we use that in another scene........please reply if you've seen this
You can make a custom reader that would make this suitable for larger games
Does the king reply?
Of course
sooo where is that exacly HKCU\Software\ExampleCompanyName\ExampleProductName??????
😅
Nice tutorial, rlly easy to understand
Is it a good idea to use a custom save system in conjunction with player prefs? That way you can keep the settings and other persistent player data separate from the core game data. That way the player prefs can persist even if the player creates new save files or loads previously created saves, and so they don't have to resubmit their settings when they make a new save file.
I've been trying to figure out how to make that work and I think using a normal encrypted save file in conjunction with player prefs for settings and other persistent data should work well, but wanted to ask if anyone knows of better alternatives, or if it's fine to just do it my way.
Was thinking the same thing for the system I am making, player prefs for settings and a saving/loading system for actual game data. Don't see why it shouldn't be able to work.
Thank you, I love you.
Can i save vector position with this?
Yeah but it's harder. I'm making my own game and it was pretty hard but still possible.
As you can see you can save float values. Vector is just a two or three float values. So just devide your vector like vector.x, vector.y, vector.z in each float variable and save it.
And then connect all these floats to your vector, i think it's simple.
Theoretically you can save absolutely everything with these 3 type: string, int, float. But sometimes it is going to be hard.
Wonderful