Question by
Kakankatten6000 · Jun 09, 2020 at 08:52 PM ·
not workingtreetreesactivenot-working
Cant setactive();
When i try to setactive something it is still disabled. I have a sprite that is supposed to be clickable and when you click it, it is supposed to show a panel.
public class TinyForestManager : MonoBehaviour {
public GameObject TinyForestPanel;
bool IsClicked = false;
void Start()
{
TinyForestPanel = GameObject.Find("Panel");
}
// Update is called once per frame
void Update()
{
}
public void OnClick()
{
if (IsClicked == false)
{
TinyForestPanel.SetActive(true);
IsClicked = true;
}
else if (IsClicked == true)
{
TinyForestPanel.SetActive(false);
IsClicked = false;
}
}
}
If you know why pls comment.
Comment
Your answer
Follow this Question
Related Questions
Unity tree branches and leaves become partly invisible in a distance 1 Answer
Trees in VR? 1 Answer
Trees like in City Skylines 0 Answers
How Do I Remove This Grid And Blue Dots That Showed Up? 0 Answers