- Home /
Question by
davidflynn2 · Nov 20, 2012 at 04:01 PM ·
c#score
C# script to display score
I am trying to write a c# script to display a score and I have hit a bit of a snag. I want the score to display in screen with the current score in it but I cant seem to get it to display this is my current code:
using UnityEngine;
using System.Collections;
public class score : MonoBehaviour
{
static public int score1 = 0;
void OnGUI()
{
GUI.Label(new Rect(10, 10, 100, 20),score1);
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613084201im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Please Help Me 1 Answer
Carrying Score over to another scene 1 Answer
Scoring System 1 Answer