Hi alI. I was not sure what forum put this so I figured I’d start here.
I have a simple game object that only moves on the x axis. Problem is when I move the cursor, while playing in Uniy3d, I can easily tell the object moves faster. Almost as if the object has some type of movement acceleration to it.
When I export it to xcode and run on my iPhone, the same thing occurs. I would put my finger on the left of the screen, start swiping to the right, and I can see the game object move faster as I get to the right edge of the screen. By the time my finger is 1/2 way through the screen, the object is about 3/4 or so on its way to the right side of the screen. The interesting thing is if I put my finger in the middle of the screen, the object appears slightly offset to the right in the same position as if I would have placed my finger on the left and started moving to the right.
public float minX, maxX;
void Update () {
Vector3 paddlePos = new Vector3 (0.5f, this.transform.position.y, 0f);
float mousePosInBlocks = Input.mousePosition.x / Screen.width * 32;
paddlePos.x = Mathf.Clamp(mousePosInBlocks, minX, maxX);
this.transform.position = paddlePos;
}