Rotate object with mouse

probably a better idea on what I want, Ive it to spawn the bullets, but i just need it to rotate on a fixed position like the image is showing. Someone guide me on how to do this please

There are many different ways depending on game. Here is one way:

#pragma strict
 
var speed = 0.5;
 
function Update () {
 	transform.Rotate(0.0, 0.0, -Input.GetAxis("Horizontal") * speed);
}

To use this script, go to Project Settings > Input and make sure that the entry for ‘Horizontal’ has the ‘Type’ set to ‘Mouse Movement’. In addition, if you plan on using multiple different screen resolutions, you will likely need to scale ‘speed’ as appropriate to the resolution.