I have an Input Field
from TextMesh-Pro inside of a Scroll View
. This Input Field
has a Content Size Fitter
to make the scrollbars change size when typing.
I am now looking for a way to move the scrollbars so that the caret is always inside of the viewport (in other ways, allow the user to always see what he is typing).
I didn’t find a way to do this automatically so I started writing a script to do it. The only problem is that I can’t find a way to get the caret’s world or screen position, only it’s index in the string.
How could I do this?