moving camera accordingly to touch

Hey there,

I am trying to move my camera around when I slide my finger over the screen using input.GetTouch(0).deltaTouch in a transform.translate method. However, I cant seem to figure out, how to move at the same speed of my finger.

So, how do I do so the camera moves at the same speed of my finger?

atm I’m using:

        Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;

        Camera.main.camera.transform.Translate(
            touchDeltaPosition.x / 2,
            touchDeltaPosition.y / 2,
            0);

~Mikkelet

Don’t divide by two? DeltaPosition is the change in position, dividing it by two makes the camera move half as fast as your finger.

I think. :slight_smile:

Yeah, the ‘2’ was just for testing, I am trying figure out what value to use to optimize the movement. It obviously cant be a random number like 2, but more like a variable that changes itself depending on the speed of my finger. :slight_smile: