Search Unity

Question TextMeshProUGUI.text.length but for visible characters only?

Discussion in 'UGUI & TextMesh Pro' started by MAWMatt, Oct 12, 2022.

  1. MAWMatt

    MAWMatt

    Joined:
    Nov 10, 2016
    Posts:
    77
    Hey folks,

    The title is terribly written but conveys exactly what I'm asking about. Is there a way for me to get the length of text, in terms of characters, that excludes all of the rich text parses? I'm animating maxVisibleCharacters of a small paragraph. The animation starts at 0 and goes until it reaches the textObject.text.length, but that value is much greater than the actual visible characters, making my audio loop stop far off.

    Thanks!
    -Matt
     
  2. MAWMatt

    MAWMatt

    Joined:
    Nov 10, 2016
    Posts:
    77
    I guess not.