Orbit Cam on IPhone

hello everybody

i’am post this topic, because i have a long research in the past, to get the functionality of the mouse orbit pan zoom.js on iphone… i don’t found something.

here i place how i did.

i take the camera relative sample, and make some modification on it.

first i deactivate the GUI.Texture of the left joystick and also deactivate the joystick script on it.

this i call the dirty way, the smart way would be, edit the control script, and take out the left joystick functions.

after this step, i place the right joystick on the middle, that’s depends, where u will have the finger swipe control.

now i deactivate the GUI.Texture of this joystick also, but let the joystick script active. u can now also use the touch pad function on the joystick. and voila u have a camera witch move to the direction of the finger swipe. editing the .int; to change speed etc.

hope that help’s, because i know my english are bad!!!

cya@unitycommunity

cheers

michael

have to ask something

no feedback, no other way to do a camaera control like this???

cheers

michael

Just to check… you want to orbit the mouse left/right around an object by moving your finger across the screen? You can get the distance moved using iPhoneTouch.deltaPosition. When you have this value, you can orbit around the object using transform.RotateAround:-

var orbitObject: Transform;
var rotateSpeed: float;
   ...

function Update() {
    ...
    var leftRightDistance = iPhoneTouch.deltaPosition.x;
    transform.RotateAround(orbitObject.position, leftRightDistance * rotateSpeed);
    ...
}