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

КОМЕНТАРІ • 40

  • @AndrewGieraltowski
    @AndrewGieraltowski Рік тому +11

    We used this tutorial to make our first game "Rebound Out", just released on iOS and Android!

  • @heyreefes
    @heyreefes 2 роки тому +8

    Yay you making it. You explain stuff pretty well sir. Tysm for your videos. I ve learnt a lot last two weeks

  • @mandamoon9149
    @mandamoon9149 2 роки тому +6

    Bmo’s blowing up 🔥 Congrats on 10k, well deserved man!

  • @globes179
    @globes179 Рік тому +8

    Great teacher, don't stop making these simple tutorials

  • @mike_b10
    @mike_b10 2 роки тому +5

    thanks, looking forward to the follow up

  • @godzillakingkongvenom
    @godzillakingkongvenom 2 роки тому +6

    Congrats on 10k! Holy smokes

  • @chicao.do.blender
    @chicao.do.blender 2 роки тому +3

    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

  • @suicune2001
    @suicune2001 2 роки тому +3

    Thanks!

  • @Unbounded7
    @Unbounded7 Місяць тому

    Trash tutorial, just didnt show anything from the project

  • @canalataquerapido
    @canalataquerapido 2 роки тому +1

    I will save all my shit with this

  • @許哲綱-q5d
    @許哲綱-q5d 2 роки тому +3

    good clear!

  • @unitynocode
    @unitynocode Рік тому +1

    Thanks for the tutorial. This is quick and easy way.

  • @godzillakingkongvenom
    @godzillakingkongvenom 2 роки тому +2

    First comment!!!!!!!!

  • @Stompin40
    @Stompin40 2 роки тому +2

    Oh wow this was awesome

  • @regys9521
    @regys9521 2 роки тому +1

    your content is just awesome, keep up the good work

  • @carlabalos3884
    @carlabalos3884 Рік тому +1

    Thanks fast and easy to understand.

  • @stefansigurdsson2146
    @stefansigurdsson2146 2 роки тому +1

    Very nice and easy to follow :)

  • @marcusfanning7513
    @marcusfanning7513 10 місяців тому

    I'm good to use this for keybinds/weapon loadout choices I'd assume right?

  • @eileeng2492
    @eileeng2492 2 роки тому +2

    Great vid
    Understable information

  • @ungearedcoder
    @ungearedcoder 6 місяців тому

    Thank you so much this really helped me in a last minute situation for a game jam! I subscribed and liked

  • @МикитаЛисенко-д6к

    I have a question, how i can use PlayerPrefs to the code under the previous video ?
    ua-cam.com/video/kAPIWJJ6NQI/v-deo.html

  • @superblue5871
    @superblue5871 Рік тому +1

    Clear and concise. Thank you!

  • @thimenlabeeuw6576
    @thimenlabeeuw6576 5 місяців тому

    Thanks alot really helped me in my project im making it was straight to the point.

  • @Irritate-lu1bt
    @Irritate-lu1bt Рік тому

    sir, can we use that in another scene........please reply if you've seen this

  • @HyperS_LaunchedUpStudio
    @HyperS_LaunchedUpStudio Рік тому

    You can make a custom reader that would make this suitable for larger games

  • @cheesyduck3553
    @cheesyduck3553 2 роки тому +1

    Does the king reply?

    • @BMoDev
      @BMoDev  2 роки тому +3

      Of course

  • @dkordy
    @dkordy 2 роки тому

    sooo where is that exacly HKCU\Software\ExampleCompanyName\ExampleProductName??????

    • @AHEK8
      @AHEK8 10 місяців тому

      😅

  • @glad_exe
    @glad_exe 7 місяців тому

    Nice tutorial, rlly easy to understand

  • @voidyll5582
    @voidyll5582 9 місяців тому

    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.

    • @themglegends9495
      @themglegends9495 8 місяців тому

      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.

  • @Predaaator
    @Predaaator 11 місяців тому

    Thank you, I love you.

  • @noobdev6464
    @noobdev6464 9 місяців тому

    Can i save vector position with this?

    • @vikini13
      @vikini13 Місяць тому +1

      Yeah but it's harder. I'm making my own game and it was pretty hard but still possible.

    • @icefox2853
      @icefox2853 3 дні тому

      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.

    • @icefox2853
      @icefox2853 3 дні тому

      And then connect all these floats to your vector, i think it's simple.

    • @icefox2853
      @icefox2853 3 дні тому

      Theoretically you can save absolutely everything with these 3 type: string, int, float. But sometimes it is going to be hard.

  • @hrilahcen8470
    @hrilahcen8470 10 місяців тому

    Wonderful