0

I am working on creating a cipher puzzle minigame as part of a larger space survival game. I am still in the research and design phase and I am having trouble conceptualizing how to handle singular character input. I want to have a coded language, with each letter having its own asset. I then want the user to translate this language by type letters into blank spaces. These blanks then need to be filled in with an Asset representing the character that was typed.

I originally attempted a solution using drag and drop assets for each letter. This felt clunky to me and so I am trying to move toward a solution involving the keyboard and mouse instead of drag and drop.

I do not have any code yet, but would be interested in some helpful examples of good ways to handle the character inputs and correctly selecting the asset which represents the letter.

0

1 Answer 1

1

You could use input fields for the place where the user would type in the character, then instead of assets representing the character just find / make your own font - you could even use TextMeshPro for even more customisation.

This would be a lot less clunky and take minimal effort - as Unity's input fields already have the option to limit character input (as well as a bunch of other settings) and you wouldn't have to have loads of assets for every character.

This is how I would handle your problem.

Sign up to request clarification or add additional context in comments.

4 Comments

So in that case would it be better to allow the full word to be entered in a single input field and check the entire word or would it be better to check each character individually? I am glad to hear I can use a font rather than an asset as that does seem less clunky.
Well, it really depends on how you want to do it! What type of visual effect are you going for? That should be the priority. If you want a single input field, you could just do if (enteredWord == answerWord) --> do something else I would concatenate (basically a fancy word for combining strings) all the characters into a single string then check it (in order to avoid checking every character individually).
As long as the guess lines up properly with the "Alien" word above it and looks right either would fit my use case. Is there one you would recommend more than the other in terms of making the visuals look proper?
I mean when I wrote my orginal answer thats what I was thinking. Something like this (proxy.duckduckgo.com/iu/…). But really its up to you - and something this simple can easily be changed later on. I would try both and see what fits your game better!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.