# Unity: Problem with swipe

I rotate a 3D object to left and right with swipe to left and right. Problem is on different devices with different pixel densities, it gets faster and slower. i.e. if you move your finger 1 cmm on one device will not rotate the object same amount that it will on another device, like a Retina and non-Retina one.

Last time I wanted to solve this I could not as IIRC there was no way to get physical pixel density of device or it's dimensions (to get density via division over resolution)

Thanks.

Presumably, using Screen.width and Screen.height should do the trick. Then you just divide the delta in dragged pixels by that total screen dimension, and this will give you some fraction between 0.0 and 1.0. You can multiply that by some fixed angle (and possibly Time.timeDelta?) to get your rotational increment.
const float dragThreshold = 0.15f;