So I’m making a custom TextBox right, and I’m at the stage where I have to make the custom cursor appear, tho I need to get the textsize with the TextService:GetTextSize
1. local UserFont: Font = Font.fromId(12187365364, Enum.FontWeight.Medium, Enum.FontStyle.Normal)
2. local function OnTextBoxTextChanged()
3. local TextSize: Vector2 = TextService:GetTextSize(string.sub(TextInput.Text, 1, TextInput.CursorPosition), TextInput.TextSize, UserFont, Vector2.new(0, math.huge))
4. Cursor.Position = UDim2.new(
5. 0, TextInput.Position.X.Offset + (TextInput.Size.X.Offset / 2) + (TextSize.X / 2) + 2, 0,
6. TextInput.Position.Y.Offset + (TextInput.Size.Y.Offset / 2) - TextInput.TextSize / 2
7. )
8. end
But I’ve been searching the entire forum to find a solution, which I did not
I get this error on line 3: