Hi everyone I'm learning the basics of unity2d and I need help coming up with a control scheme that I want to implement for mobile phones. I want to create some type of button at the bottom right of the screen that would remotely control the turret that is sticking out of the base (the turret and base are separate gameobjects). If the user is touching the button and moves his/her finger to the left, the turret should match that and same for moving right. So basically I want the turret object to rotate on a point based on touch input from a remote button. Here is an image of my scene so far (excuse the awful paint art): http://i.imgur.com/ZO3oMyz.png Any help would be appreciated. Thank you.
I wrote a tutorial yesterday covering this exact topic. I hope it helps you learn! http://imakeinternet.com/unity-2d-tutorial-screen-player-touch-controller/
Thanks for the response. I actually saw your tutorial the night before I posted my question I was able to get a guitexture on my screen that recognizes whether the user is swiping left or right. However, I'm having a lot of problems trying to rotate the turret. I've tried rotating it with different axis values but none of them seem to work. I want the turret to rotate on a point...any ideas on this?
Set the pivot point of the turrent barrel (you want to make this a separate sprite) to the bottom and use rigidbody2D.AddTorque() or transform.Rotate() on it.