# Touch interface problem

**URL:** <https://forums.unrealengine.com/t/touch-interface-problem/483453>\
**Category:** Mobile\
**Tags:** touch-interface, unreal-engine, Android, question\
**Created:** [May 16, 2021, 1:13pm UTC](https://forums.unrealengine.com/t/touch-interface-problem/483453 "2021-05-16T13:13:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dipesh1510](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dipesh1510](https://forums.unrealengine.com/u/Dipesh1510)\
**Post date:** [May 16, 2021, 1:13pm UTC](https://forums.unrealengine.com/t/touch-interface-problem/483453/1 "2021-05-16T13:13:26Z")

</div>

i had created a script for rolling ball movement (android). to move the ball i need to click the button each time, while i had selected on pressed in widget blueprint.and if i press the button ball doesnt move and if i play this game in android game lags a lot . Can anyone help me out (SORRY FOR BAD ENGLISH)

 ![338937-screenshot-191.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/b/1/4b17660b4c9e83514ce38389cca3cfefdafacc52.png)

 ![338938-screenshot-192.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/c/59c4bbf7d619f0e4757fb8f3ab5d3b54013fdf37.png)

 ![338939-screenshot-193.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/c/bec50a3d8166ddde4b9aab37d5bf2a452facdf03.png)

---

<div class="post-metadata">

**Author:** ![Dipesh1510](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dipesh1510](https://forums.unrealengine.com/u/Dipesh1510)\
**Post date:** [May 16, 2021, 1:14pm UTC](https://forums.unrealengine.com/t/touch-interface-problem/483453/2 "2021-05-16T13:14:38Z")

</div>

![338940-screenshot-194.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/6/a06626db7cadf14bc3094594383c38e8a5b9200e.png)

---

<div class="post-metadata">

**Author:** ![Dipesh1510](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dipesh1510](https://forums.unrealengine.com/u/Dipesh1510)\
**Post date:** [May 16, 2021, 1:16pm UTC](https://forums.unrealengine.com/t/touch-interface-problem/483453/3 "2021-05-16T13:16:52Z")

</div>

THE BALL SHOULD MOVE BY PRESSING THE BUTTON BUT IT DONT MOVES I NEED TO CLICK THE BUTTON AGAIN AND AGAIN TO MOVE THE BALL . CAN ANYONE HELP ME OUT ?

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [May 16, 2021, 3:44pm UTC](https://forums.unrealengine.com/t/touch-interface-problem/483453/4 "2021-05-16T15:44:18Z")

</div>

Hi there! The main thing - **OnPressed** events are happen only once and that’s all for one button press! So you need to do it like this: when button **OnPressed** event happens set some bool variable connected with this button to true, and when same button **OnReleased** event happens set this flag to false. This is just keeping state of your buttons. And movement should be implemented in Tick body(less recomended) or Timer body (more reccomended), depending on flags that are true. There is also more practical way - not to keep flags by yourself, but just use buttons states for this purpose =)
