How would I put an autocomplete feature onto my in-game console

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Juan

I am at the moment trying to build an in-game console for my user to enter commands and interact with different objects in the game. The console I am developing will be able to compute commands that the user inputs into the command box, and from that will manipulate the character in my scene to collect different items.

I want to make the gameplay as easy as possible for the user to interact with, in terms of using the in-game console, each according to their ability. Whilst some will be familiar with certain commands, others will be less so, and will therefore need some kind of hint or reference as to what they are imputing.

Would be very much appreciated if someone could give me some code, or a method to implement this functionality as a feature, or a snippet of code.

Thank you.

:bust_in_silhouette: Reply From: SF123

You could use a RegEx or something like if string.startsWith to try and detect what the user is trying to type something and then have a Label Node that goes to whatever position that is kind of gray or something and then if the user pressed like tab or whatever you want the keybind to be it appends that to the console.