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 :smiley:

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;
    }