mousePosition = Input.mousePosition; mousePosition.z = Mathf.Abs(cam.position.z - ball.position.z); mousePosition = Camera.main.ScreenToWorldPoint(mousePosition); dir = mousePosition - object.position; ball.AddForce ((dir).normalized * force);