On Click If Statement

Hi, Could someone please help with me this script? What I’m trying to do is add 1 point to TotalPoints, which is in the script Points whenever I press a button, and a certain game object is false. Am I trying to do something that’s not possible?

I keep getting the error: Cannot implicitly convert type void' to bool’

using UnityEngine;
using System.Collections;

public class IfFalse : MonoBehaviour

{
	public GameObject Object1;
	private Points points;

	void Awake()
	{
		points = GetComponent<Points>();
	}

	public void OnClick()
	{
		if (Object1.SetActive(false))
		{
			points.TotalPoints = points.TotalPoints + 1;
		}
	}
}

Thanks

Your problem is with your if statement, you are trying to set it to false instead of checking if it is false.

 if(Object1.ActiveSelf == false){

}

WUCC

use

Object1.activeSelf == false

instead of

Object1.SetActive(false)

and

points.TotalPoints = points.TotalPoints++;