Reset the mouse cursor at center of screen by spring

Hello everyone,

I’m currently creating a FPS spaceship where you’re piloting your ship only whith the mouse for the directions. Actually the sight for shooting is Locked on center (see screenshot), but I would like to give it some freedom on the screen to shoot enemies. So the part that causing issues is that I would like to move on the screen, but with a sort of “spring” back to the center when static.

If anyone see how I can achieve that ?




Try to test with Cursor.lockState

You have the documentation about this here : Cursor.lockState