- Home /
Touch mouseorbit
Hi I am using MouseOrbit.js on iPhone but am experiencing a problem in that whenever you touch the screen it instantly changes camera rotation to a new position dictated by finger screen position relative to camera target. I am wondering how to adjust it so that touching the screen does not instantly affect the camera position, but a touch swipe does. I want the new starting touch position to retain the cameras last position. Basically, I want to be able to make a series of side swipes ( say from left to right ) to smoothly rotate the camera around the target. As it is now, the first swipe rotates it but as soon as i touch the left side of the screen again in order to swipe again, the camera position abruptly changes to a radical new location which makes it all a bit messy. I am sure there is something on UnityAnswers about this but I just cant locate it.Thanks.
Answer by ghart · Jul 30, 2011 at 02:33 AM
Hi. Did you ever find a good solution? I have the same issue. Thanks.
Answer by cj_coimbra · Aug 25, 2011 at 06:04 PM
Try catching the initial touch position in TouchPhase.Began Then move it only in TouchPhase.Moved or Stationary with Quaternion.Lerp(...) method between that initial position and the current touch position. Tweak the rate of the move so it fit your needs.
Answer by cj_coimbra · Aug 25, 2011 at 06:04 PM
Try catching the initial touch position in TouchPhase.Began Then move it only in TouchPhase.Moved or Stationary with Quaternion.Lerp(...) method between that initial position and the current touch position. Tweak the rate of the move so it fit your needs.
Answer by ElMouse · Sep 30, 2011 at 11:41 AM
I am experincing absolutely the same problem and its driving me CRAZY O_O
On pc everythyng works fine, but when i launch app on android, it looks like the position variables are misbehaving on touch somehow...
Answer by richardzzzarnold · Oct 19, 2011 at 07:53 AM
I couldnt work out how to do a TouchPhase.Began adjustment as suggested by cj.coimbra but I made a decent substitute by adding TouchLook script to an object that was then parented to the target object ( camera target ) and then making the camera a child of the touchlook target.