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?
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.
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.
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?
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?
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"?
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.
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.
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 ?
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.
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.
I like the video and those mouse clicks are so oddly satisfying... as a beginner loved it
Thanks man, awesome tutorial - short and straight to the point! Helped a lot !
I had searched for so many videos and this helped me. Thanks
(sorry for my english I am from Germany)
Glad I could help
Great tutorial, short and straight to the point with no confusing jumpcuts 👍
Excellent tutorial! Coding starts at 1:55
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.
It was the best JSON data tutorial dude, thanks a lot!
thank you so much... Its crazy how the person who didn't talk actually helped me lmao!
saved my life thank you
Shortly and well explained
Thanks Man helped me a lot
Thank you for the video it was helpful
Nice Tutorial man thanks❤
Thanks man , hope u the best 🙏🌷
Perfect tutorial 10/10
Thanks so much. Simple, works.
Thx but what about a lot of inventory items save and load?
If u use Application datha path does that make sense after the build ? dont you need persistentDataPath ?
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?
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.
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.
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?
how to save inventory items, like helms swords and etc ? with own stats
Hey I’m sorry to bother but would you be so kind to explain how can I add my players position into this.
It does work in my Unity Editor, but it doesnt work on my Android tablet. Why, pls need help :)
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?
They can be separate files just add to the directory string like + class name or something. And you can use to use multiple classes
how do i store the last scene that the player was on?
how do i change the value from another script
what about objects in json?
Thanks
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"?
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.
Unauthorized access exception: access to the path error, how do I fix? What have I done wrong?
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.
Does this method of serialization support List ?
Yes.
unfortunatelly it doesn't work in webgl build
bro is these Unity API Thing or C?
thank you so so much
Thank you
nice tutorial!
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 ?
did you found a solution for it?
Thank you ❤️
you should test bout loading it :(
love it !
good video !, how could I load the data saved in another scene
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.
you know, giving the viewer a fraction of a second to actually see what you're clicking on wouldn't hurt.
Thanks a lot for your feedback.
I will definitely keep this in mind for future videos 👍
Best video thx
thanks nice song
tnx
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.
That is the most horrible click sound I've ever heard
no have talk twitter or facebook?