every block spawn score increases by own
heres the code \
private void SpawnBLOCK()
{
Vector3 spawnPos = spawnpoint.position;
spawnPos.x = Random.Range(-maxX, maxX);
Instantiate( block, spawnPos, Quaternion.identity );
score++;
scoreText.text = score.ToString();
PlayerPrefs.SetInt("HighScore", score);
PlayerPrefs.GetInt("Highscore");
}
void CheckHighscore()
{
if (score > PlayerPrefs.GetInt("Highscore" , 0))
{
PlayerPrefs.SetInt("Highscore", score);
}
}
void updateHighscoretext()
{
highscoretext.text = $"HI - SCORE: {PlayerPrefs.GetInt("HighScore", 0)}";
}
}