- Home /
Scoring System Unity 6.4 C# 2D Game
Hello, i would like to create a scoring system in my 2d game so that every 2 or maybe 3 seconds, the score count increases by 1, and i would like this score to be displayed on the screen somehow, thanks. I know i might need the be "using UnityEngine.UI" and i would need variables such as a int score and a public Text soundCount or something simliar. Thank you :D
Answer by PrisVas · Feb 04, 2015 at 04:55 PM
Will be something like that, i did not test it.
int score = 0;
Text texScore;
void Start() {
InvokeRepeating("AddScore", 2, 2F);
}
void AddScore() {
score++;
texScore.text = "Score" + score;
}
Your answer
Follow this Question
Related Questions
How to Set the Game Speed Based on the Player's Current Score? 1 Answer
2 problems when workin with sprites on Unity3D 1 Answer
C# UI list item drag onto 2d sprite in world space? 1 Answer
Which type of Variable do I need to use to change the Value of a text UI object ? 0 Answers
Help check click out of UI 2 Answers