Text not changing in inspector?

So I made this script when the player enters the trigger a gameobject gets deleted and text is supposed to change in inspector but it doesnt. its a string text
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class House : ScareTactics
{
    public GameObject Relic;

    private void OnTriggerEnter(Collider col)
    {
        if(col.tag == "Player")
        {
            ShakeCamera(1, 3);

            Relic.SetActive(false);

            string name = col.gameObject.GetComponent<TypeWritterEffect>().fullText = "hello";
            

        } 
    }


    private void OnTriggerStay()
    {

    }

    private void OnTriggerExit()
    {

    }

}

Add another method to your typewriter class that looks like this:

public void StartWriting(string aText)
{
    fullText = aText;
    StartCoroutine(ShowText());
}

Now instead of setting the fullText variable from outside you simply call “StartWriting” with your text

col.GetComponent<TypeWritterEffect>().StartWriting("hello");