Limit a max number of characters in the character name

General development topics: using various Unity tools, publishing games, etc.
Post Reply
Pititia12
Posts: 2
Joined: 25 Jan 2024 12:45

Limit a max number of characters in the character name

Post by Pititia12 »

Hello, it's my first time here, I looked for a question similar to mine on the forum and couldn't find it.

I would like to use the comand @imput to let the player chose the Main Character's name, but I would like to limit a max number of caracteres.

I wouldn't like the player to choose a name like "Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr." for MC, for UI reasons, so I would like to limit it to between 10 and 12 characters maximum. How could I do this?

Thank you very much <3

Elringus
admin
Posts: 524
Joined: 11 May 2020 18:03

Re: Limit a max number of characters in the character name

Post by Elringus »

Hey, Make a custom variable input UI (https://naninovel.com/guide/user-interf ... uilt-in-ui) and use Character Limit property on the input field component: https://docs.unity3d.com/Packages/com.u ... Field.html

Pititia12
Posts: 2
Joined: 25 Jan 2024 12:45

Re: Limit a max number of characters in the character name

Post by Pititia12 »

I got it here, thank you! ^^

Post Reply