Issue with setting color of instantiated text object

Hello!
I have been trying for about 2 hours now to fix this issue. When I click on my object it creates an instantiated object with TMP Text as a child (Prefab). When I try to change the color of this text, I cannot find a way to do it, it just stays white. In this particular attempted solution I tried to put a script on the TMP object itself but the text color will not change no matter what I try.

P.S: The console will run (“Setting color to yellow”) thousands of times in a row.

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

public class ClickTextColorScript : MonoBehaviour
{

    public bool IsYellow;
    private TMP_Text textMeshProC;
    void Start()
    {
        textMeshProC = GetComponent<TMP_Text>();
    }

    void Update()
    {
        if (textMeshProC == null)
        {
            Debug.LogError("TMP Error");
            return;
        }

        Debug.Log("IsYellow: " + IsYellow);

        if (IsYellow)
        {
            Debug.Log("Setting color to yellow");
            textMeshProC.faceColor = Color.yellow;
            textMeshProC.color = Color.yellow;
        }
        else
        {
            Debug.Log("Setting color to white");
            textMeshProC.faceColor = Color.white;
            textMeshProC.color = Color.white;
        }
    }

}

It’s likely that something else is trying to control that property at the same time.

This might be another script, or even another copy of this very script. Sometimes odd things happen when copying a component, for example, like the TMP component you think is assigned in the Inspector is in fact on some other gameobject.

Another potential source: I know this kind of issue can happen if you’ve got an Animator that has claimed that property. Have you ever added an Animator? What happens if you remove that Animator?