I want to implement a panning system, and people said to me that the cursor should be locked in place during the panning.
However in Unity all I could find is setting the Cursor.lockState to Locked, but that causes the cursor to be snapped to the center of the screen. Which means that everytime the user finishes the pan, the cursor is now in the center of the screen. Which is really bad UX.
It would be all fine if I could just set back the cursor to the position where it was when the pan started. Sadly, as far as I know, Unity doesn't support this. I managed to implement it on Windows by importing user32.dll and then calling SetCursorPos.
But I plan to release my game on Mac and Linux too, so I guess even if I could implement this for all supported platforms, this sounds cumbersome and errorprone.
Is there a good crossplatform solution for this problem? Why is it so hard to implement this? If there isn't a cross platform solution, how could I do the same for Mac and Linux?
Thanks in advance!