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