Quantcast
Channel: Questions in topic: "playerprefs"
Viewing all articles
Browse latest Browse all 1333

PlayerPrefs not quite working

$
0
0
So i'm trying to make an experience system using PlayerPrefs right now. Previously I had a working script like that that saved the player's position. But later i started this level system, and I accidentally mistaked the position script with the level script and deleted it and it stopped working. I've been trying to finally make it work for like 8 hours (maybe 2 per day) and yet still doesn't work. There are no errors and after restarting the game the value doesn't load onto it's previous state. using System.Collections; using UnityEngine.UI; using UnityEngine; public class PPLS : MonoBehaviour { public int lp; public Text lvltext; public int Level; void Update() { PlayerPrefs.SetInt(Level.ToString(), lp); Level = lp; PlayerPrefs.GetInt(Level.ToString()); lvltext.text = Level.ToString(); } } If i made grammar mistakes then sorry, i don't speak english. If there any questions about the script i'll try to answer. If anyone has made this working then please send the whole script or there is only one error, then the broken line. Thanks

Viewing all articles
Browse latest Browse all 1333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>