Search Unity

Design a letter-by-letter player input field

Discussion in 'Game Design' started by taivasltd, Mar 30, 2019.

  1. taivasltd

    taivasltd

    Joined:
    Mar 27, 2019
    Posts:
    20
    Hello,

    I would like to do something "fancy", as shown in the pic. The player can enter their name letter by letter and:
    1. erase each letter from right to left with backspace
    2. the dash/single letter placeholder of the next letter that is empty flashes (to indicate it is the next one to be filled) - this is optional but could look nicer
    3. Allow only letters and max length (based on the dashes/single letter placeholders)

    Is the only option to create X separate input fields, one per letter? Have you found anything similar in the asset store? took a look but did not find.

    Untitled.png
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    If you want this much control, then don't use an InputField (and certainly don't use multiple input fields!). Just use a Text (or TMProUGUI) for each letter position, and write a script that watches Input.inputString to update them.
     
    Ryiah and Joe-Censored like this.
  3. taivasltd

    taivasltd

    Joined:
    Mar 27, 2019
    Posts:
    20
    many thanks Joe will give it a try! if I implement something I will post my efforts for anyone interested :)
     
    JoeStrout likes this.