- Home /
UNITY 2D: My In-Game-Currency resets to 0
So i am making an in-game currency and its like I have set that after a bit score a bit of currency would increase like If score is >= 2 then currency+= 10; and so on for more different scores. but i am having an problem as if i the score is less than the one in script like if its less than 2 then the currency resets to 0, idk why. i am using playerprefs, ik its not safe and all that but for now im just going to use this.
https://drive.google.com/file/d/1EyaYb2pfh7NKFkbDAF9frQgJ3vGIDp99/view?usp=sharing this is the script im using to control my game score
https://drive.google.com/file/d/1MICI4W5UoGwiswqnXtwYbh8Q2BSOMMqh/view?usp=sharing and this is the script im using for my in game currency. Please help me :D
Answer by KimMingyuSVT · Sep 06, 2019 at 11:17 AM
and if the currency lets say is 50 and the next time you play and get the score which couldnt get you more than 50 coins, than also it resets back to the currency that is set into that particular score you earned at that moment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Restricting movement with Mathf.Clamp 4 Answers
How do i give Coordinates (x, y) to an Array 1 Answer
How can i prevent from mouse to collide with thirdpersoncontroller ? 0 Answers