UI Button Input only allows one digit – how to accept multiple digits?

hey @5HT.dvd how are you?

Im not sure if im following your question.

I’m not sure if I’m following your question.

You mean, for example, the problem you mentioned: 9 + 3.
That would be 12.

The player presses number 1, everything is fine, but then when they press 2, it overrides the 1 instead of appending it, right? Also, based on your Blueprints, you’re calling ‘Handle Input’, which I assume is checking the answer in the GameMode.

If that’s the issue, it’s probably because you’re setting the text every time the player presses a button, which ends up overriding the previous value instead of adding to it.

There are different ways to fix this.

What I would do is store the number in a variable (as an integer), and then convert it to text to update the TextBlock.
For the gameplay logic, you can check the answer once the full number has been entered. That means if the answer is 4, the player might have to write 04—but that depends on how your game is designed.

Something like this:

1 Like