How can you find the position of the last string character on the screen?

The title is somewhat confusing, and I’m having trouble figuring out how to find the UI position of the last character inside of a string, if it’s even possible. Can anyone help me or lead me in the right direction because I’m pretty lost at this point.

(ScalarX, PixelX, ScalarY, PixelY)

like this

local gui = gui.Position ----- gui here
 obj =  gui.UDim2.Y

I’m not trying to find the position of the GUI object itself. I’m looking for the position of the last character inside the textlabel. Essentially, I’m creating a cursor that flashes right in front of the last character in the label as it types out. I’m going for something along the lines of what I just attached. (Apologies for the low resolution image)
Screen Shot 2021-10-03 at 4.46.58 PM

idont think you can get character inside the textlabel position try other way like adding a green icon

1 Like

Alright, thanks. I’ll try to substitute it with something easier to work with.

Perhaps using TextService:GetTextSize, you can find the position of the last element and if you have the green cursor as a child of the text label, you can set its position to the size of the text:

local TextService = game:GetService("TextService")
local label = -- text label reference
local size = TextService:GetTextSize(label.Text, label.TextSize, label.Font,, 9e4))
cursor.Position = UDim2.fromOffset(size.x, 0)

I’ll give it a shot! Thanks for your help!