- Home /
MouseOrbit resetting position
Hi, I am using MouseOrbit script for Orbitting camera in Android device to rotate the camera around cue ball in snooker. It works nice in PC builds, but when I deploy it on Android device, it takes input on touch instead of mouse movement(obviously there's no mouse). I've no problem in that.
But when I am done with change of direction and want to fine tune the movement and touch again, the camera resets to default position and I've to do the movement again. That's annoying for a user. I've tried everything I could. Can you suggest something which I should try to save the position and start from there only?
PS: My custom mouse orbit script is here.
Edit:
I've tried changing one line from this:
var rotation = Quaternion.Euler(y, x, 0);
to this
var rotation = Quaternion.Euler(y, x, 0)*target.rotation;
and it almost worked, now it's resetting at different rotation angle. But still the problem is same.
Answer by Creator347 · Mar 12, 2013 at 01:31 PM
I've managed to solve this problem by deactivating the first touch. I am deactivating the first touch and save the touch position, and if the touch position changes, than the mouseorbit gets activated. Using this the problem gets sorted out.
Let me know if any of you needs the exact code.
Hi @Creator347,
If you would be so kind as to post the code that worked that would be great!
I have been looking for a working swipe to orbit camera for touch screen and have not been able to make it work. This may also be due to my very beginner level. $$anonymous$$any posts from years ago ask the same question but few if any provide answers which I could get working.
Thank you
Your answer
Follow this Question
Related Questions
Possible to use an external camera (USB) while running on Android? 1 Answer
Dragging Camera based on Touch 0 Answers
Android: Game not fitting on screen 1 Answer
Camera Size on Android 0 Answers
2D Camera (Android, Iphone) 1 Answer