Search Unity

Know each time text characters are changing

Discussion in 'UGUI & TextMesh Pro' started by wtetotew, Jan 16, 2021.

  1. wtetotew

    wtetotew

    Joined:
    Apr 12, 2020
    Posts:
    68
    I have a script which make the score update over delta time. (to make a score increasing effect).
    I would like to have a sound playing each time the scrore number are changing.

    Is it possible to get each time textmesh pro text charcters are changing (to trigger the sound).

    Is ther a better way to do this ?

    Thanks
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    In your own code where you handle the updating of the text, you should also handle the sound. You could use an event delegate to notify your sound script /.manager to then play a sound or have some function being call, etc. Many ways to implement this but it should be triggered when you update the text which you have control over.