Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug TextMeshPro Delay & Scale possible Bug

Discussion in 'Editor & General Support' started by Sandler, Nov 24, 2020.

  1. Sandler

    Sandler

    Joined:
    Nov 6, 2015
    Posts:
    241
    Hi i was just about to optimize my GUI since i was experiencing a few lags on android mobile.
    Most of them were prefab instancing on mobile. Though i swear that didnt lag in older versions. Doing GUI sometimes feels like navigating though a minefield.

    Anyway im using the latest 2019.4 Version & the latest TMPro package.

    My GUI works like that: After a touch event i scale in (0,0,0 -> 1,1,1) the GUI Window.
    Sometimes there is an delay before i scale in the window.
    The GUIs gameObject is always active and it has a CanvasGroup & Child-Canvas Object on it.

    When i scale in the GUI instantly, without delay i dont get any spikes in the profiler.

    But as soon as i add a frame delay (via delayed update() or StartCoroutine)
    private IEnumerator _WaitForOneFrame(Action callNext)
    {
    // do some actions here
    yield return null; // wait for 1 frames
    callNext();
    }

    I get a spike in the profiler:
    TextMeshProUGUI.InternalUpdate() - 96 calls 1156.64ms
    TextMeshProUGUI.UpdateSDFScale() - 2 calls
    ...GenerateTextMesh() ....

    This Window has two TextMesh Monos, which seem to get regenerated, when i scale it in after a delay. Without delay all works fine.
    I also tested this on Android.

    I will do some more tests, fading it in, or moving it in does not trigger that.

    Edit: I posted it in the wrong section. Made a new thread in ui&textmesh
     
    Last edited: Nov 25, 2020