TMP Text not enabling

I’m having some problems when I try to enable some text, i’m not quite sure how to fix my code either so if someone could help that would be great, thank you!

My code is

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class Dialog : MonoBehaviour
{
    public TextMeshProUGUI textDisplay;
    public string[] sentences;
    private int index;
    public float typingSpeed;

    public GameObject continueButton;

    public void Start()
    {
        StartCoroutine(Type());
    }
    public void Update()
    {
        if(textDisplay.text == sentences[index])
        {
            continueButton.SetActive(true);
            Debug.Log("enabled!");
        }

    }
    IEnumerator Type()
    {
        foreach(char letter in sentences[index].ToCharArray())
        {
            textDisplay.text += letter;
            yield return new WaitForSeconds(typingSpeed);
        }
    }

    public void NextSentence()
    {

        continueButton.SetActive(false);

        if (index < sentences.Length - 1)
        {
            index++;
            textDisplay.text = "";
            StartCoroutine(Type());
        }
        else
        {
            textDisplay.text = "";
            continueButton.SetActive(false);        }
    }
}

and im having problems with the

    public void Update()
    {
        if(textDisplay.text == sentences[index])
        {
            continueButton.SetActive(true);
            Debug.Log("enabled!");
        }

part.

My inspector is setup like

Thank you all!

First I would suggest a better implementation. Since you’re already having your coroutine handle the typing in a for loop, why not have the continuebutton activate after the for loop exits? This would make it much cleaner as you’d get rid of the every frame check, you would no longer have to check for string comparisons, and you would know that the button is activated after the text is done being typed.

Otherwise, you are not enabling text. I assume your text is already visible. You are turning on a GameObject which happens to be your button. So, you didn’t explain what isn’t happening. Is your ContinueButton not turning on? Or is it on but not working? Are you getting an error?