Get position of specific character from Text inside a canvas

I’m working on a typing game. i plan to have a cursor placed right before the next character you have to type, but all my code is based on Text object, so I’m stuck because i don’t know if getting the position of a single character is even possible.

@TheZero3546 Since it’s been more than a year since this question was asked, you might have been solved the problem eventually. If not, here’s my reply.

Yes, it is possible if you use TextMeshPro instead of the simple Text provided by the built-in library. You just need to import the TMPro library in your project from the package manager.

For the text instance you use TextMeshProUGUI. You can access all the information in the field textInfo, and if you want a specific character you access textInfo.characterInfo which is an array that stores all the information of the single characters.
There are a lots of informations, including the bottom left, bottom right, top left and top right position. Here is an example.

using TMPro;

public class TMProTest : MonoBehaviour {

        public TextMeshProUGUI text; // your text mesh pro component.
        public int index; // the index of the character you need the info of.

        private void Test() {
            // The informations of the text.
            TMP_TextInfo textInfo = text.textInfo;
            // The informations of the character at given index inside the text.
            TMP_CharacterInfo charInfo = textInfo.characterInfo[index];
            // The bottom right position of the character.
            Vector3 bottomRight = charInfo.bottomRight;
        }

    }

You can look at the documentation for the list of fields, although it’s not much exhaustive. Class TMP_TextInfo
Struct TMP_CharacterInfo

Hope to be helpful.