How to detect how much was mouse moved only horizontaly?

Hi all.
Basic Information
I need to know how much player moved with mouse but not matter on position because it will be ignored when cursor reach edge of monitor (because cursor move not farther/ don’t change position).I need something based on speed of mouse.

More details
I making 2D top-down hack’n’slash space shooter game where player piloting a spaceship. Camera rotate to match rotation of player spaceship (it mean rotate spaceship to cursor is bad idea). I need to know how much player horizontaly moved with mouse (both positive and negative value) to add it to player’s spaceship Z rotation and make him rotate. I alredy have code to rotate ship by angle i just need to get angle to move (calkulation of angle : transform.rotation.eulerAngles.z + mouseMovedDistance).



Play around with the result of the method Input.GetAxisRaw(“Mouse X”), that might be what you’re looking for.