- Home /
Camera orbit with touch
Hi, I am making a game on iPhone that I need to be able to orbit a camera 360 degrees around an object. This needs to be done however by dragging the screen to move in any direction, not by swiping to move 90 degrees. Any help would be much appreciated, I've never worked with mobile before. Thanks
"This needs to be done however by dragging the screen to move in any direction, not by swiping to move 90 degrees" - I think that you need to clarify what you mean by "dragging the screen to move in any direction" and "swiping to move 90 degrees".
I’ve seen tutorials where people just swipe quickly and it rotates 90 degrees then locks in position, I want it free moving so it flows around in any direction, sorry I don’t really know how to explain it very well. So you can put your finger on the screen, move it in any direction and the camera orbits in that direction smoothly.
The best way I can describe what I need is the system on Gun Dissembly 2, when dissembling a fun you can orbit the object as well as pinching to zoom in and out, that is exactly the system I want.
Answer by anthot4 · May 23, 2018 at 09:13 AM
@Westy00 Look at transform.eulerangles. Store the rotation of the axis you want to rotate as a float and then increase or decrease it each frame the user touches the screen to rotate the camera. I have done what you are trying to achieve myself and spent a few hours researching the best way to do it. There are many ways to do it but I have found eulerangles to be the best one as you can keep track of the rotation of the gameobject.
Your answer
Follow this Question
Related Questions
How can I detect touch on anroid or iphone 2 Answers
What is the command to check whether player is touching the screen or not?? 1 Answer
Rotate camera smoothly to certain degrees with iphone touch 2 Answers
Not getting a response when a touch doesn't move with TKtouchkit 1 Answer
2D Camera (Android, Iphone) 1 Answer