Unity Learn home
0
1
I hate Application.persistentDataPath
4.2 Mviews
According to the description, this exercise should take 30 min. It took me something around 4 days to make it work, reviewing the tutorials again and again. Either I suck at programming, or the 30 min expectation was way too optimistic...
I any case, my tips:
1)
Debug.Log(Application.persistentDataPath); <- this is a live saver.
Don´t forget to use a regular slash before the file name, or it will not find the file at all (both for loading and saving).
2)
Use your empty gameobject (the one that will remain in DontDestroyOnLoad) only for STORAGE purposes. Do not put any effing script on it. Think of it as a container.
3)
All your menu scripts must remain in your Canvas object. If you fail to do this (like I did), your buttons will work only on the first run, but when you come back to the menu the buttons do not find the scripts anymore (lesson learned).

Have as much fun and frustration as I did, and remind that this is a learning path!!!
Media
1
1
j
jamesjay007
2 years ago
I relate to your struggle with the Application.persistentDataPath! It seems like what's supposed to be a 30-minute task often ends up taking much longer. It's all part of the learning curve in programming, where sometimes small tasks can become unexpectedly complex. Don’t get too down on yourself; these challenges are just stepping stones to becoming more adept! If you ever need a break from coding, and you're curious about testing your luck instead of your skills, you might enjoy exploring some online casinos. Specifically, the site find more offers a selection of minimum deposit casinos that are great for getting started without a big commitment. It could be a fun and low-stress way to unwind after a long session of debugging!