- Home /
Different swipe speed between iPad2 & iPad3
Hi
Currently i got some ipad apps problem... I wonder if anyone have any idea why the pinch zoom and swipe drag speed react differently between ipad2 and ipad3... I had changed void update to fixed update but still the outcome are the same. Dunno why.... Does anyone have an idea how to fix it? Thank you!!!
You need to post your code. The most likely reason is that you are using screen coordinates for your calculations, and the resolutions of the two devices is not the same.
Ok my code is kinda messy, it has 690 lines and if i post everything here will most likely be more confusing, but yea... here is part of my code. Thanks again
void FixedUpdate()
{
transform.Translate((-touch_position.x/dragSpeed) * Camera.main.fieldOfView/(36f - (Camera.main.fieldOfView/1.2f)) * dampspeed , (-touch_position.y/dragSpeed) * Camera.main.fieldOfView/(36f - (Camera.main.fieldOfView/2)) * dampspeed, 0f);
if (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.$$anonymous$$oved && !zoom.title_mode && !zoom.credit_mode )
{
speedTouch0 = Input.GetTouch(0).deltaPosition.magnitude / Input.GetTouch(0).deltaTime;
if((speedTouch0 > 5f))
{
touch_position = Input.GetTouch(0).deltaPosition ;
dampspeed = 1f;
}
}
else
{
dragging = false;
}
if(dampspeed > 0.1f)
{
dampspeed -= 3f * Time.fixedDeltaTime;
}
else
{
dampspeed = 0;
}
}
You shouldn't use FixedUpdate for anything except physics; certainly not for input, since it can miss events.
Right now I'm trying to find a way to limit the swipe speed to remain the same in both ipad2 and ipad3. And yes FixedUpdate didn't change anything. Do you have any idea how to fix the issue?
Your answer
Follow this Question
Related Questions
animation to play faster over time 2 Answers
Limited Energy Regeneration 3 Answers
Time.deltaTime problems? 1 Answer
Calculating a bullet time of impact based on speed and distance 1 Answer
Objects moving faster after time 1 Answer