Hello, I’m from Russia, so I’m sorry for my English.I started making a game on unreal engine 4 and I need a field to appear and so that the user can enter only numbers in this field. Is it possible to do this using C++ or blueprint easier
You can use UMG (BP) to:
- Make a Widget Blueprint.
- Make it focusable so it will take keyboard entries
- Allow text entry
- Bind the event ‘on text entered’ or something similar
- Read the input
- Sanitise the input
- [Do whatever you want to do with it]
You can also bind to the function when any text is attempted to be entered (On text Changed) and check to see if it is a number. If it is not, delete it
You can link into slate in C++, but it gets hard.
I would also recommend using Unreal Engine 5, not 4, unless there is something niche or specific that you need in it.