Increasing point only by one when score reaches to a particular number.

In my game, I want to give a special ‘star’ point when the score is reached to 10, 15, 20.25…
I have tried this but failed as “star” point count keep increasing until the score is 10,15,20.

private int getStar;
private int gameScore;

void Update(){
		StarScoreUpdate ();
		CheckScore ();
}
void StarScoreUpdate(){
		if (getStar = true) {
			starScore++;
			getStar = false;
		} 
	}

	void CheckGameScore(){
		int starScoreTemp = gameScore % 5;

		if (gameScore > 9 && starScoreTemp == 0) {
			getStar = true;
		}
	}

A modulo operator will return the remainder of a division. In this case, 0/5, 5/5, and 10/5 would all yield the same result.

What might work better for you would be to instead have a target score and check if you’ve exceeded that.

// Baseline values to match your example
public int targetScore = 10;
public int targetIncrease = 5;

if(gameScore > targetScore)
{
	GetStar(); // running a function directly from here instead
	targetScore += targetIncrease;
}