How can I treat mouse movement as joystick input?

Is there a way to make mouse movement act like a joystick, including the dead zone? So, if the mouse is moved away from the middle of the screen I can make an object move?

For example, I have a space ship and if the mouse is in (or near) the middle of the screen, it will keep facing forward. But if it is moved to the left/right, or top/bottom of the screen, the ship will start rotating. (And will keep rotating until the mouse is returned close to the middle. (There will probably be an onscreen crosshair or similar indicating the mouse position)

Thanks!

Actually nevermind, I figured out an easy way to achieve what I wanted. For anyone else interested, I simply made two float variables within the movement script, called “mousePosX” and “mousePosY”, and set them to 0. Then in the Update function, I set mousePosX += Input.GetAxis(“Mouse X”), and the same for mouse Y, which I then used to control adding torque along the x and y axes.

Thanks for the help!

Yes, you can, using Input.mousePosition.