I have been trying to solve this for 3 days now and I have been unable to solve it myself. What is happening is when I open my inventory, my mouse is in theory supposed to be shown and unlocked. Now this almost works, except when I try to actually move my mouse around, it almost instantly gets moved straight to the center. I am using Unity version 5.4.0f3.
My code that does this (in the inventory script) is:
if (isShown) { // If the inventory is opened
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None;
}
I have no other code that affects the cursor except for this in a separate script:
if (inventory.isShown || pauseManager.isPaused) { // If inventory is opened or game is paused
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None;
} else {
Cursor.lockState = CursorLockMode.None;
}
Any help would be greatly appreciated ~