Rotate the object with the touch

Hi

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

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

UE 4.8.0
Android

Rotating like:Traffic Racer

please help

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.

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!).

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!

1 Like

maybe these can help you

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