Hi, My aim is that Ui button is off when player starts the game. When he reaches 3 points button appears. Code does not seem to work. Button is off at the beginning but it does not appear when the player reaches 4 points. My code is here. What seems to be the officer problem?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ButtonAppear : MonoBehaviour
{
public GameObject Button;
bool SetActive = false;
void Update()
{
if (ScoreManager.score <= 3)
{
Button.gameObject.SetActive(false);
Debug.Log("noButton");
}
else
{
Button.gameObject.SetActive(true);
Debug.Log("Button");
{
}
}
}
}