Search Unity

Question how do i set character limit for text mesh pro?

Discussion in 'UGUI & TextMesh Pro' started by CodeWithJohnny, Sep 23, 2022.

  1. CodeWithJohnny

    CodeWithJohnny

    Joined:
    May 25, 2022
    Posts:
    1
    I have a textMesh Pro that i would like to set the amount of character, it from 1 to 9999, but i press play and i use a button to manipulate my textmeshpro, and i can write characters in the scenn till infinite...i just need to validate only a maxlengt of 4
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    You can use onValueChanged on the input field. If you have more characters than the allowed count simply remove the last bit