If score spawn objects

If someone scores i want an object to spawn if i use += 1; it says int cant convert into bool if i use <= 1; it just keeps spawning

using System.Collections;

public class Ifmove : MonoBehaviour {

	public GameObject Row;

	
	// Update is called once per frame
	void Update () {
		if(PointScore.pointScore += 1){
			Instantiate(Row, transform.position, Quaternion.identity);
		}
	}
}

please help thank you

This should solve your issue.

void Update () {

	//Assuming PointScore.pointScore is 0, this will fire off once and never again after that
	PointScore.pointScore++;

	if(PointScore.pointScore <= 1){
		Instantiate(Row, transform.position, Quaternion.identity);
	}
}

The issue you experienced was the fact that you were attempting to check an integer as a bool as you are using `if(PointScore.pointScore += 1) which is not a valid expression. So with the solution I provided pointscore is now only going to resolve as true if it is less than or equal to 1