- Home /
How can I make my score editable?
Okay so I found this scrip online but its displaying the score as its own GUI which is fine but thers not much edition I can do with it. So how do I make the GUI public so that I can drag and drop the text I want to use. Hope my question made seance.
using System.Collections; using UnityEngine.UI; using UnityEngine.SceneManagement;
public class Score : MonoBehaviour { float playerScore = 0; // Use this for initialization void Update() {
playerScore += Time.deltaTime;
}
void OnGUI()
{
GUI.Label(new Rect(10, 10, 100, 30), "Score" + (int)(playerScore * 10));
}
}
Answer by IvovdMarel · Oct 17, 2018 at 06:02 AM
This is the old way of displaying UI and definitely not the easiest if you're trying to create a custom score-field. I recommend watching some tutorials such as:
Your answer
Follow this Question
Related Questions
After I initially add score it keeps adding. 2 Answers
whats wrong with my high score code? 1 Answer
Scoring Points. 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers