I’m having trouble getting this code to work… this snippet of script below is attached to my player;
var cacheScore:int;
var newScore:int;
cacheScore += Time.deltaTime;
PlayerPrefs.SetInt(“newScore”,cacheScore);
Here is the full script below which is attached to my Main Camera in my localscore scene. I’m on Unity iphone paid version, trying to test on my iphone to no avail (and in the Game mode). Score always shows 0 even though I play, get a score of say 10 and it goes to the localscore scene fine… any ideas? Much appreciated with any help, since I’m going a bit mental on this… ![]()
#pragma strict
var showScore: int;
var scorestyle : GUIStyle;
function Start(){
var showScore = PlayerPrefs.GetInt(“newScore”).ToString();
}
function OnGUI()
{
GUI.Label(Rect(Screen.width / 2 - 100, 200, 400, 25), "Your Score: " + showScore,scorestyle);
}