Shoot gun at mouse position


I am thinking of an on-rails shooter kind of game and I would like to make the crosshair and the gun move (shoot at the mouse position) but the direction of my character shouldn’t change.
I don’t have an idea how to do this.
Any tips and pointers would be welcome.

Thanks in advance

For shooting in the direction of the crosshairs, I used this which works well. Hope it helps.