I have a 2d image that I move when with mouseDrag(). For some reason the object that I am moving with mouseDrag() moves faster then the mouse. I have added a buffer to slow this affect down, and I have noticed that the buff needs to be changed depending on my screen size, but I am at a loss on how to determine the correct amount for the object to move as the mouse moves. Here is what I am working with so far.
enter code here
void OnMouseDrag()
{
selected = false;
MoveBoard();
}
public void MoveBoard()
{
// figure out the amount to move the game board
// distance the mouse moved
Vector3 amountToMove = Input.mousePosition - previousMousePosition;
// convert the mouse y cord to z cord
float temp = amountToMove.y;
amountToMove = new Vector3(amountToMove.x*xBuffer , 0, temp*yBuffer);
//move the board
transform.position += amountToMove;
// set this position as the mouse last position
previousMousePosition = Input.mousePosition;
}