Hi. I have had an issue for a little while now that’s becoming increasingly frustrating. Does anyone have any thoughts that may help me resolve it?
When navigating through the editor’s sceneview, dragging with the right mouse button rotates the camera. When the mouse is moved to the edge of the screen, it wraps to the other side, allowing the user to continue the camera rotation.
On my home PC, the sceneview camera often randomly jumps in rotation while wrapping. This happens about half of the time, isn’t affected by mouse speed and occurs when wrapping from any edge of the screen. The jump seems to be a random number of degrees too.
I am working in Unity 4.3.0f4 on a windows 8.1 with two monitors. I’ve tried unplugging one of the monitors, but the issue still occurs.
It still happens from time to time. I hold down Alt and use the Left Mouse Button to orbit the game object in the Scene and when the mouse reaches the corner of my Display, it jumps by 180 degree sometimes… not always. (ver 4.3.3f1)
I’ve been having this issue on and off for years - Finally got annoyed enough and tracked it down to the delta for the MouseDrag and it’s preceeding Layout events being off by the screen width or height sometimes when the cursor is wrapped.
Setting the delta in the event to something regular when it appears too large eliminates the camera issue for me.
The same issue can occur with any drag event that wraps, so for UI stuff you might need to also adjust the delta for Layout events (I’ve only tested with the camera since it’s easy to see the jump when it happens).
Here’s the code I’ve used as a workaround incase it’s been plaguing anyone else: