Wanted to create a button that can add number in text box. For example. I have a text start with number 0. Once i press add button then number will increase to 1 and it goes on.
- Create a blueprint widget
- Add a text box
- Add a button
- Scroll down the details panel to “Events”
- Add a “OnClicked” event
- Create a public Integer variable
- Drag a node of OnClicked and add a SetText(Text Box) function
- Connext its target to you textbox object
- Drag you Integer variable into the field
- Set its value “+1” by using the “Integer + Integer” function
Thats it
Hi, you want to add 2 buttons and a Text object (set this one to “Is Variable”) to a widget. Then use the OnClicked Event of the buttons to change the Text value, something like this:
Regards.
Thanks for the answer
Thanks for the clear answer!
What if I want to set a certain number? Let say first click value is 1, second click is value 5, third click value is 10.
Use a branch between the last node and the operator ("+" or “-”) to check for the textbox condition. If its bigger than 1, set the true node to +5 otherwise the false to +1.