Drag Camera Rotation Sensitivity Issues

I have implemented a system where the player can rotate the camera and so far it has worked great on Android. Running the same code on an iOS tablet with roughly the same ppi results in a drastically increased rotation sensitivity.

Here is the code I have on my camera:

var t = Input.GetTouch(0);

float dt = Time.deltaTime / t.deltaTime; //sometimesTouch.deltaTimeis0 :/
if (float.IsNaN(dt) || float.IsInfinity(dt))
     dt = 1.0f;

x_velocity += t.deltaPosition.x * dt * 0.2f;
y_velocity += t.deltaPosition.y * dt * 0.2f;

transform.rotation = Quaternion.Euler (y_velocity, x_velocity, 0);
transform.position = Focus.position + Rot * newVector3(0.0f, 0.0f, -Distance);

I’m thinking perhaps I should put this sort of thing in FixedUpdate()? Anyone have any ideas?

I don’t think you need any reference to Time.deltaTime in there…

Your velocity should be simply t.deltaPosition / t.deltaTime

Unless I’m really confused about what you’re trying to do :eyes:

The problem is that sometimes t.deltaTime is zero, and also I need it to be framerate independent.