How to start animation after dialogue ends a.k.a currentLine == 3

So I have a dialogue and when it is finished (hits line 3) it is destroyed. I want to start an animation after the dialogue is finished. So basically it is character that player talks to and when the dialogue is finished the character runs away. This running away is an animation that I want to play after the dialogue is destroyed after hitting line 3. So basically I want to say animation true when hitting line 3 of the dialogue.

I have tried and failed, I might be missing something.

public class ActivateTextAtLine : MonoBehaviour
{
    public Animator animator2;
    public TextAsset theText;
    public int startLine;
    public int endLine;

    public TextBoxManager theTextBox;

    public bool destroyWhenActivated;

    // Start is called before the first frame update
    void Start()
    {
        theTextBox = FindObjectOfType<TextBoxManager>();
        if (theTextBox.currentLine == 3)                     //this should work ?
        {
            animator2.SetBool("PlayRun", true);
        }
    }

    // Update is called once per frame
    void Update()
    {

    }
    void OnTriggerEnter2D(Collider2D other)
    {
        if(other.name =="Player")
        {
            theTextBox.ReloadScript(theText);
            theTextBox.currentLine = startLine;
            theTextBox.endAtLine = endLine;
            theTextBox.EnableTextBox();
                if (destroyWhenActivated)
            {
                Destroy(gameObject);
            }
        }
    }
    void OnDestroy()     
    {
        
    }

    void OnTriggerExit2D(Collider2D other)
    {
                theTextBox.DisableTextBox();
    }
}

You know that the code in your Start () method is only running one time, right? So it is likely == 0 at the beginning and that’s why the condition is true when you use 0 and not working for the other lines because the condition is not being checked… You could put it in the Update () method to check every frame. Or you could start a coroutine and use a while loop (while currentLine < 3 for example) and start your run animation when the while loop returns false