- Home /
My Button Only follows half of the commands.
public Button FriendButton;
public void BusinessButton ()
{
LifeTx.text = "Business Life";
BusinessTabBool = true;
PersonalTabBool = false;
FriendButton.enabled = false;
FriendButton.gameObject.SetActive (false);
}
public void PersonalButton ()
{
LifeTx.text = "Personal Life";
PersonalTabBool = true;
BusinessTabBool = false;
FriendButton.enabled = true;
FriendButton.gameObject.SetActive (true);
}
The LifeTx part of the button works great. The Bools work but in the inspector it doesn't show them turning on or off. But I am trying to turn another button on and off with a different button and that is not working at all. It gives the error "Object reference not set to an instance of an object" every time I try and use it. But, I am setting which button I want to turn on and off in the inspector window.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612063848im_/https://answers.unity.com/themes/thub/images/avi.jpg)