- Home /
Android "mouse" speed while GetMouseButtonDown(0)
Hey guys, I searched around a bit but could not really find an answer or solution to my problem so here goes:
I have an orbiting camera that will only orbit the character under the following conditions:
if (Input.GetMouseButtonDown(0))
{
xxSpeed = Input.GetAxis("Mouse X")*10;
yySpeed = Input.GetAxis("Mouse Y")*10;
}
So as you can see, here I get a onetime speed that the mouse or finger is moving at the time of the click or touch.
if (xxSpeed > 1 || yySpeed > 1 || xxSpeed < -1 || yySpeed < -1){
//my orbiting script goes here
}
And here I just filter out small movements so that only if the player really wants the camera to orbit it will. (But not on small movements)
Now my problem is, the mouse pointer (not visible but in terms of location) on the android touch screen stays where your finger last left the screen. So when you touch the screen again the "mouse pointer" jumps from where it last were to where your finger is touching now. So the speed (xxSpeed and yySpeed values) of a click on the pc would be very small if I hold the mouse still and click, but the speed for the touch would always be large cos it jumps to the point.
I must be missing something really obvious or doing something really stupid cos I can't be the first one to actually try and differentiate between a swipe and a touch.
Thank you in advance!
Try finding out the "delta movement" of the mouse/touch, which is basically how much the input changes from the last frame you check. $$anonymous$$aybe this will work.
Your answer
Follow this Question
Related Questions
Swipe control for circle (Can do swipe left/right) 2 Answers
Bug? Need to wait about 10 seconds to get back to normal 1 Answer
Android Drag By Steps 0 Answers
multi touch / swipe issues 5 Answers
Frame Drop on Touching or Swiping Screen 0 Answers