Save/Load Data using Json File(Json Serialization/Deserialization) in Unity Game Engine

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

Комментарии • 57

  • @sukidhardarisi4992
    @sukidhardarisi4992 3 года назад +12

    I like the video and those mouse clicks are so oddly satisfying... as a beginner loved it

  • @yourfriendlypally2249
    @yourfriendlypally2249 2 года назад +8

    Thanks man, awesome tutorial - short and straight to the point! Helped a lot !

  • @rikcn-fm6zi
    @rikcn-fm6zi 3 года назад +8

    I had searched for so many videos and this helped me. Thanks
    (sorry for my english I am from Germany)

  • @UrbestM8
    @UrbestM8 Год назад +2

    Great tutorial, short and straight to the point with no confusing jumpcuts 👍

  • @JuicyyDevelopment
    @JuicyyDevelopment Год назад +2

    Excellent tutorial! Coding starts at 1:55

  • @briana3186
    @briana3186 2 года назад +3

    Thank you so much for this! I've finally got the beginning of a save system working now. This help put the missing pieces in place.

  • @MetehanYengil
    @MetehanYengil 2 года назад +3

    It was the best JSON data tutorial dude, thanks a lot!

  • @echo7project904
    @echo7project904 Год назад +2

    thank you so much... Its crazy how the person who didn't talk actually helped me lmao!

  • @nanintudiosindiegamesandmusic
    @nanintudiosindiegamesandmusic 3 года назад +3

    saved my life thank you

  • @Ignacy-yt6mh
    @Ignacy-yt6mh 2 года назад +1

    Shortly and well explained
    Thanks Man helped me a lot

  • @umerfarooq8494
    @umerfarooq8494 2 года назад +3

    Thank you for the video it was helpful

  • @Fusraumspinne
    @Fusraumspinne Год назад +1

    Nice Tutorial man thanks❤

  • @hoseinstar9661
    @hoseinstar9661 2 года назад +1

    Thanks man , hope u the best 🙏🌷

  • @marcelolopezdelerma
    @marcelolopezdelerma 2 года назад +4

    Perfect tutorial 10/10

  • @Beefdamouthful
    @Beefdamouthful 2 года назад +1

    Thanks so much. Simple, works.

  • @gmangman123
    @gmangman123 Год назад +1

    Thx but what about a lot of inventory items save and load?

  • @josue7156
    @josue7156 11 месяцев назад

    If u use Application datha path does that make sense after the build ? dont you need persistentDataPath ?

  • @Anonymous_Devs
    @Anonymous_Devs Год назад

    hey how u made ur screen, visual studio and stuff look smooth and cool?
    edit: also how can i make it so when i load the json file in start it wont have an error if the json doesnt exist?

  • @umerfarooq8494
    @umerfarooq8494 2 года назад +1

    One question:
    File.WriteAllText(Application.dataPath + "/WeaponDataFile.json", json);
    This line would work for all platforms, right?
    Android iOS etc
    What's in my mind right now is that it works only for windows.

    • @Unity3DSchool
      @Unity3DSchool  2 года назад +1

      Application class methods and properties are mostly platform independent. This way we can write some codes without worrying about platform.
      So Yes. It will work on all platforms.

  • @syedaalena7902
    @syedaalena7902 2 года назад

    Can you plz tell how to save the player name and score on one button and when we click on that button the panel will open on which the player names and score will be saved?

  • @chernik_us2752
    @chernik_us2752 2 года назад

    how to save inventory items, like helms swords and etc ? with own stats

  • @stevanrose7090
    @stevanrose7090 Год назад

    Hey I’m sorry to bother but would you be so kind to explain how can I add my players position into this.

  • @online.fabian
    @online.fabian Год назад

    It does work in my Unity Editor, but it doesnt work on my Android tablet. Why, pls need help :)

  • @bartonfile6569
    @bartonfile6569 2 года назад

    If I have more Data than just WeaponData, do I make other scripts for it? Like WeaponData. PlayerData. GameData. EnemyData.
    Do I save and load all of these separately?
    Does it all need to be on a single Json file?

    • @PeterMilko
      @PeterMilko 2 года назад

      They can be separate files just add to the directory string like + class name or something. And you can use to use multiple classes

  • @yuvalcastiel6542
    @yuvalcastiel6542 2 года назад

    how do i store the last scene that the player was on?

  • @puppetdev8141
    @puppetdev8141 2 года назад

    how do i change the value from another script

  • @Krystian-i1o
    @Krystian-i1o Год назад

    what about objects in json?

  • @PeterMilko
    @PeterMilko 2 года назад

    Thanks

  • @Lajlaj
    @Lajlaj 3 года назад

    Hey! If my players data that I want to save are stored in different scripts, such as its position and number of hearts, how would I acess those instead of "Weapon Data"?

    • @Unity3DSchool
      @Unity3DSchool  3 года назад +3

      Create PlayerData instead of WeaponData. Inside SaveToJson method, Collect all player related data from all the scripts and assign them to the fields of PlayerData object. Hope it make sense.

  • @donjohnson4347
    @donjohnson4347 3 года назад

    Unauthorized access exception: access to the path error, how do I fix? What have I done wrong?

    • @Unity3DSchool
      @Unity3DSchool  3 года назад +1

      Either you are accessing a file that is at a secured location Or file path is wrong. Try printing the complete file path in log and see if you can access the path via file explorer.

  • @sadiqabbaszade4789
    @sadiqabbaszade4789 3 года назад

    Does this method of serialization support List ?

  • @se5d
    @se5d Год назад +1

    unfortunatelly it doesn't work in webgl build

  • @mrniceguy8298
    @mrniceguy8298 2 года назад

    bro is these Unity API Thing or C?

  • @Thuner2007
    @Thuner2007 3 года назад +2

    thank you so so much

  • @programmingbird
    @programmingbird 11 месяцев назад +1

    Thank you

  • @ilovecode3727
    @ilovecode3727 Год назад

    nice tutorial!

  • @nabilhamouda1472
    @nabilhamouda1472 3 года назад

    i like this video which give me idea as a begginer
    I wrote a JSON File which contain different Texts this as an example :
    [
    {
    "Title" : "Introduction",
    "Text" : "life is good and nice etc."
    }
    {
    "Title" : "Description",
    "Text" : "this car is beautiful etc."
    }
    ]
    just want these texts get displayed on Text Mesh Pro component in unity, first text mesh pro for the title and other for the text . and through a buttons Next and Back I can change from text to other. so I want to put the JSON file on a server and get it on unity components .. Please can you help me with that ?

  • @Enginering
    @Enginering 3 года назад +1

    Thank you ❤️

  • @StickyLabDev
    @StickyLabDev Год назад

    you should test bout loading it :(

  • @liju24
    @liju24 3 года назад +1

    love it !

  • @crisslopezgallardo4879
    @crisslopezgallardo4879 3 года назад +1

    good video !, how could I load the data saved in another scene

    • @Unity3DSchool
      @Unity3DSchool  3 года назад +4

      The Json file is in your Asset. You can access this file from any scene. See LoadFromJson() method. It is responsible for reading the Json file from its physical location.

  • @whitetiana3022
    @whitetiana3022 Год назад +1

    you know, giving the viewer a fraction of a second to actually see what you're clicking on wouldn't hurt.

    • @Unity3DSchool
      @Unity3DSchool  Год назад

      Thanks a lot for your feedback.
      I will definitely keep this in mind for future videos 👍

  • @significant_quest
    @significant_quest 3 года назад +1

    Best video thx

  • @Arca3D-yc3ni
    @Arca3D-yc3ni Год назад

    thanks nice song

  • @mamadpars2981
    @mamadpars2981 2 года назад

    tnx

  • @3bears744
    @3bears744 2 года назад

    Can somebody who understands json really well msg me? I've been stuck on this for a very long time. I can get this tutorial working no problem but having issues with it in my game still.

  • @Fwuzeem
    @Fwuzeem Год назад

    That is the most horrible click sound I've ever heard

  • @Benzitczo
    @Benzitczo 2 года назад

    no have talk twitter or facebook?