# Rotate the object with the touch

**URL:** <https://forums.unrealengine.com/t/rotate-the-object-with-the-touch/331855>\
**Category:** Community & Industry Discussion\
**Tags:** object, unreal-engine, touch, rotate, question\
**Created:** [September 11, 2015, 12:14pm UTC](https://forums.unrealengine.com/t/rotate-the-object-with-the-touch/331855 "2015-09-11T12:14:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_e375f2fd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e375f2fd](https://forums.unrealengine.com/u/anonymous_user_e375f2fd)\
**Post date:** [September 11, 2015, 12:14pm UTC](https://forums.unrealengine.com/t/rotate-the-object-with-the-touch/331855/1 "2015-09-11T12:14:25Z")

</div>

Hi

How to rotate an object by touching the left and right direction?

[https://forums.unrealengine.com/attachment.php?attachmentid=55079&d=1441034039](https://forums.unrealengine.com/attachment.php?attachmentid=55079&d=1441034039)

UE 4.8.0  
Android

Rotating like:Traffic Racer

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/5/85329d1be9670c56a2c33462dd4bee7288a7bc3e.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e375f2fd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e375f2fd](https://forums.unrealengine.com/u/anonymous_user_e375f2fd)\
**Post date:** [September 12, 2015, 2:52pm UTC](https://forums.unrealengine.com/t/rotate-the-object-with-the-touch/331855/2 "2015-09-12T14:52:13Z")

</div>

please help

---

<div class="post-metadata">

**Author:** ![Mattboyguy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mattboyguy](https://forums.unrealengine.com/u/Mattboyguy)\
**Post date:** [October 22, 2015, 9:55pm UTC](https://forums.unrealengine.com/t/rotate-the-object-with-the-touch/331855/3 "2015-10-22T21:55:48Z")

</div>

Do you want a constant rotation or just as long as the right arrow is held down rotate?

I would try a while loop. While the button is down set boolean to yes which activates a true for a branch. From there do some sort of get rotation and add .5 rotation degrees (this would be the speed I believe). Once the finger is lifted the branch turns false and thus stops rotating. I’m not at my UE4 laptop so I cant be super specific, but that is the general logic I would use.

Let me know if that works.

Good luck.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_da91052b1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_da91052b1](https://forums.unrealengine.com/u/anonymous_user_da91052b1)\
**Post date:** [October 8, 2017, 2:34pm UTC](https://forums.unrealengine.com/t/rotate-the-object-with-the-touch/331855/4 "2017-10-08T14:34:25Z")

</div>

Hi! It seems I’ve gotten an answer. sorry for the _really_ late response, I’ve only come across this question now, while I was facing the same problem (Although it may not be useful to you by now, hopefully to some other people it’ll come across useful!).

 ![216059-captureans.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/d/42dda55d5808572bd0b85fd169eb6a5b00eede98.png)

So what basically happens between each tick is that it calculates the amount the touch input’s moved from the previous tick and added it into the rotation. Hope it helps!

---

<div class="post-metadata">

**Author:** ![cool77](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cool77](https://forums.unrealengine.com/u/cool77)\
**Post date:** [August 26, 2018, 3:10pm UTC](https://forums.unrealengine.com/t/rotate-the-object-with-the-touch/331855/5 "2018-08-26T15:10:46Z")

</div>

maybe these can help you

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/7/d/c7d00975c7c78055906dac08c53faede0239cb48.jpeg "Ue4 Android Touch rotate mesh tutorial -part1") ](https://www.youtube.com/watch?v=mOXY9qLGZlg)

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/0/2a037562c7c3180b04276c080f5589ed94a24cc4.jpeg "Ue4 android touch widget interact tutorial -part4") ](https://www.youtube.com/watch?v=KLr3tpsbkLY)

---

<div class="post-metadata">

**Author:** ![Jdiab12071](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jdiab12071](https://forums.unrealengine.com/u/Jdiab12071)\
**Post date:** [November 7, 2023, 4:20pm UTC](https://forums.unrealengine.com/t/rotate-the-object-with-the-touch/331855/6 "2023-11-07T16:20:06Z")

</div>

Thank you so much!!! that’s what I’ve been trying to do on my own for so long now and couldn’t figure it out
