Disallow blank input for Text Field UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ehdusjenny
Posts: 11
Joined: Thu Dec 29, 2022 3:58 pm

Disallow blank input for Text Field UI

Post by ehdusjenny »

Hello,

Currently I have my dialogue system set up, and I'd like to forbid the user to enter an empty input in their response via Text Field UI. I have Standard Input UI Field component's "Allow Blank Input" unticked. However the user can still press enter and submit an empty input.

I've checked that I have the correct corresponding Panel, Label and Input Fields added as well. Would you know what other config I'm missing?

Thank you for your help!
User avatar
Tony Li
Posts: 22130
Joined: Thu Jul 18, 2013 1:27 pm

Re: Disallow blank input for Text Field UI

Post by Tony Li »

Hi,

Here are two ways to accomplish that:

1. UNtick the StandardUIInputfield's Allow Blank Input checkbox.

2. Or, if you want to do more thorough checks for things like banned words, add dialogue entry nodes that check the text and loop back if it's blank, similar to the conversation at the bottom of How To: Read Input From Player During Conversations.
Post Reply