over 8 years ago
Hey guys i am working on the prototype like this:
how can i validate the characters like in this game.
And if he types wrong he is not allowed to type, Like if I need to type"Hello" , and user press 'e' key on the start then nothing should happen, User can only type 'h' then 'e' then 'l' ...... so on,
but this seems to be not working for me please Help! i am using unity 5 and its ui inputfield.
Hey, Yes I have gone through the video.
I am saying something like this:-
string ToPrint = "Hello";
string temp = "";
string toCheck = "";
toCheck = ToPrint.Substring (0, 1);
void Update ()
temp = Input.inputString;
if (temp == toCheck)
void ShowText(string val)
myTxt.text += val;
if(myTxt.text.Length < ToPrint.Length)
toCheck = ToPrint.Substring (myTxt.text.Length, 1);
Hope this will work for you.
can you please describe more clearly have u seen the video @inder
Hey, You don't have to put the validation direct on your final InputField.
My suggestion is, that you use a temporary variable for the validation and if your validation comes successful(true)
then you can put the correct string in the final InputField.
So with this if user will press wrong keys that will not display in your InputField.
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Terms of Service
| © copyright 2023 FindNerd.com. All rights reserved.
Sign up using