Problem with OnMouseDrag on a touchscreen

Hello,

at the moment I am developing an application/simulation for a local museum (as part of my bachelor thesis).
A few days ago we tested the application on their device (ELO 1939L - Windows 7) and everything seems to work, but the rotation of the Game Object when dragging via touch - there’s no problem when using a mouse.

I’ve before tested the application on my PC (Windows 10 - mouse) and also my phone (Android - touch) and everything works smoothly there.

This is my code:

public class Rotation : MonoBehaviour
{
    float rotSpeed = 150;

        private void OnMouseDrag()
        {
            float rotX = Input.GetAxis("Mouse X") * rotSpeed * Mathf.Deg2Rad;
            float rotY = Input.GetAxis("Mouse Y") * rotSpeed * Mathf.Deg2Rad;

            transform.Rotate(Vector3.up, -rotX, Space.World);
            transform.Rotate(Vector3.right, rotY, Space.World);

        }

}

Do you guys have any idea why it wouldn’t work on their touch screen device?

Thanks in advance!

Having the same issue, on a Windows 10 laptop touchscreen! Any solution yet?

1 Like

OnMouseDrag still doesn’t work on a windows 10 touchscreen, but works with a mouse and on android devices. Any help would be appreciated.