Graphic Build Error

When I am doing the quest UI, this error came from nowhere, at least I did not know how it happened.
Had tried delete anything imported recently.


Thank you for helping me.

Interesting… this is usually something that happens with async operations (you can only update graphics on the main thread).

Paste in your QuestUI.cs and I’ll see if I can figure out what might be causing this.

I found that i start a coroutine to deactive an UI game object like that in Start function:


void Start()
    {
        StartCoroutine(Deactive());
    }
    public void ShowNoti(string message)
    {
        notiText.text = message;
    }
    private IEnumerator Deactive()
    {
        yield return new WaitForSeconds(5f);
        gameObject.SetActive(false);
    }

Maybe this caused the error. I havent seen any error since I commented this script. But now all my UI Elements’ rect Transform’s Pos Y became NaN.

Not sure what would cause the NaN, but… try it this way:

void Start()
{
    Invoke("Deactivate", 5f;
}

void Deactivate()
{
     gameObject.SetActive(false);
}

While Invoke is still technically a highly specialized coroutine, it’s contents run on the main thread.

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

Privacy & Terms