Input.GetTouch(0).deltaPosition for rollout on orbit camera behaving strangly
Hi,
I have a solid camera orbit script up and running, at least when using the mouse. When I switch to Touch, it still works but the rollout of the camera after letting go was missing.
So after a bit of debugging I found out that whenever I do this:
if(Input.GetTouch(0)phase == TouchPhase.Moved)
{
var deltaTouchOne = Input.GetTouch(0).deltaPosition;
}
the output is something like this for the last few frames:
(0.0, 0.0)
(2.0, -1.0)
(50.0,-1.0)
(48.0,-1.2)
as you can see, the real speed when letting go was about 50 px per frame. But then it always drops to nearly zero or sometimes even negative numbers. This results in a rollout to small or short to even notice since Unity thinks I barely moved the pointer before letting go. This also happens, when I calculate the delta myself using the position of the touch input.
has anyone else experienced this? Any help?
I'm nearly ready to just filter out the last three frames of output just to get to something approximately right.
Your answer
Follow this Question
Related Questions
Moving relative to camera 0 Answers
difficulty in detecting multi touch 1 Answer
Mouse or Touch events independent of framerate 0 Answers
camera problem orbit/fallow 0 Answers
Stuck with Camera Orbit Script 1 Answer