D
D
Denioo2019-03-16 21:12:58
Unity
Denioo, 2019-03-16 21:12:58

Trouble launching game in unity?

Good afternoon!
The problem with unity 5. The fact is that the game settings, namely, for example, when I want to save the PlayerPrefs values, and in test mode, run my developments, an incomprehensible thing happens. The matter is that Unity does not save values ​​for any reason not clear to me.
For example:
Let's say I play, I set a record, the record is displayed correctly in the top record, but when I restart the game or when I click Replay in the most running game. Everything is reset to 0. All coins, everything that is written into the game using PlayerPrefs. Also, for some reason, all PlayerPrefs get lost when switching between scenes.
Perhaps after I compile the project, this will not happen, but I'm not sure for sure. Perhaps someone has come across something similar.
I would be grateful for any tips and advice!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2019-03-16
@Denioo

https://docs.unity3d.com/ScriptReference/PlayerPre...
read about this method)
if you are using Set correctly. and you check value through Get. It’s almost certainly the fact that you don’t save the changes to disk (until that moment they are in the RAM, and in theory everything should be ok when switching between scenes) check if you are calling somewhere
else (or some third-party plugin or asset)
://docs.unity3d.com/ScriptReference/PlayerPre...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question