Hi All,
I am sure this is an easy fix but I can’t for the life of me figure out where I am going wrong. I have a restart button and a score displaying. The Restart text and button work but the score does not display anything except Score Text. This is my code:
using UnityEngine;
using System.Collections;
public class HighScore : MonoBehaviour
{
public GUIText scoreText;
public GUIText restartText;
float playerScore;
void PlayerScore()
{
scoreText.text = "Score: " + PlayerPrefs.GetFloat(“playerScore”);
}
void Update()
{
restartText.text = “”;
restartText.text = “Press ‘R’ for Restart”;
if (Input.GetKeyDown(KeyCode.R))
{
Application.LoadLevel(“Main”);
}
}
}
For now I am only starting out with a very basic idea of showing my Score on this screen. I have tried changing the scoreText.text = “I don’t work” and when I run the game it still only displays Score Text. I am sure it is probably something really easy I am missing.
Thanks.