Create Flashing Cursor

Hi there,
I want to create a flashing cursor, which would sit at the end of my text, as I write it on screen, just as you would see in any text input field.

In my mind, I would need either a world position of the last symbol/letter typed or access to the Atlas Texture. I can not see how to get either.

So, does anyone know how I could create a flashing cursor or get one of the two values mentioned?

The position of all characters, words, lines, etc. of text on screen for any given text object are contained in the TMP_Text.textInfo which contains several data structures such as characterInfo[ ], wordInfo[ ], etc which contain everything you need.

To help you visualize this information, add the TMP_TextInfoDebugTool.cs to any text object. This script is contained in the TMP Examples & Extras. This script is also great to help you understand how to access the information contained in the textInfo.

Thanks,
Yes I had a quick look at that yesterday, but it was not something I picked up on how to do… so I have left it for now… would you be able to provide a few Iines of code which would show me how to locate the world position of “T” in the word “CAT”, for example?
Thank you

Also, for DOText(), is Scramble the only type of animation? I am looking to add a new letter to a preset word every other second… I can do this on my own, but would be neat if there was a native function… Cheers!

@
EDIT SOLVED:
See Solution Below, oringal question. If you have a better solution, please share. Thank you


Hi there, I am wondering, is there way to detect if there is a space " ", via space bar or other?

Reason being is, my game uses text to compare answers, trivia if you will…

Sometimes if a space is applied after the typed word (mobile keyboard) if you use autocorrect or word options. Regardless, I would like to know if my word is "CAT " (note the space after the T), how could I (if at all), detect that?

----------my solution-----

        string word = tmp_thisPlayer.text;


        int wordLength = word.Length;
        int indexLast = wordLength - 1;
        if(indexLast >= 0)
        {


            string lastCharacter = word[indexLast].ToString();
            string wordAdjsuted = "";
            if (lastCharacter == " ")
            {
    
                for (int i = 0; i < indexLast; i++)
                {

                    wordAdjsuted = wordAdjsuted + word[i].ToString();

                }
                word = wordAdjsuted;
   
            }
            else
            {
                print("LAST CHARAFTER IS NOT SPACE ");

            }


        }
        else
        {
            ///no word entered
        }

Hi @Stephan_B ,
I am attempting to set the width of an instance of a TextMeshPro, in scene, via code, however, at the moment, it is not repsndiong.

Thoughts?

    private void Start()
    {
//this works....
        tmp_this.text = "x" + valueOfMultplier.ToString();
///this does not work....
        tmp_this.outlineWidth = 0.75f;
}

Is there any update here?