I was wondering if there was a way to link the size of the text input field to the length of the text itself? For example if the user types a long name, the text input field (= red rectangle in images below) has to change it’s width accordingly. The same goes for the case when a user types a short name. Please see images attached.
You can do this by binding the text input width on its own text and adding a Custom Script converter to compute the width you want. In the example below, I keep a fixed width of 400 pixels for texts with less than 20 characters, then I add 10 pixels for each additional character.
Thank you for your answer! It is very clear and helpful!
When I copied your script code and adjusted some parameters to my experience, The red rectangle changes accordingly until I am at character 42 then the first characters start to fall off. Please see image below.
I’ve set the script to:
if (INPUT.length > 20)
800+(INPUT.length - 20) *10
else
800
Besides, could you tell me how I can make sure that the input text stays the same for the duration of the experience? Because right now, if I re-enter the scene, the input text field has been reset.