Quit button doesn't do anything

Help! My other buttons(next and all dialogue choice buttons) all work perfectly, but for some reason my Quit button just doesn’t react at all. I even tried deleting it from the prefab and recreating it, and made sure to link it to the serialized field in the Dialogue prefab.

Dialogue UI Code:

        void Start()
        {
            playerConversant = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerConversant>();
            playerConversant.onConversationUpdated += UpdateUI;
            nextButton.onClick.AddListener(() => playerConversant.Next());
            quitButton.onClick.AddListener(() => playerConversant.Quit());

            UpdateUI();
        }

PlayerConversant Code:

        public void Quit()
        {
            currentDialogue = null;
            currentNode = null;
            isChoosing = false;
            onConversationUpdated();
        }

I figured it out. The problem became more clear when I realized if I clicked in the upper right hand corner of my Quit button, it worked! So why wasn’t the entire square clickable? Some googling indicated there can be issues with buttons if they aren’t at the bottom of the hierarchy, so I moved it to the bottom(since it’s ignoring the layout, this didn’t introduce any layout issues), and voila! Now the whole square is clickable.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms