making and object rotate with mouse

hello all iv been looking around for some help on how to make a script on making something rotate with the mouse what i mean is like thing thing the game something like that cause im in the making of a 3d platform game and i want the arms to look at the mouse for the aiming right now im using a script that uses the mouse input to rotate the arms but i want the arms to look at the mouse

example http://img194.imageshack.us/i/runaimfire.png/ http://img713.imageshack.us/i/runaimfire01.png/

the reason it doesn't aim right is cause im using only the y axis so what would i need to do to fix this please help i have no idea how to do this

this is the script im using right now

var verticalSpeed : float = 2.0;

function Update () {

var v : float = verticalSpeed * Input.GetAxis ("Mouse Y");

transform.Rotate ( -v, 0, 0);

}

if you know how this is done please help :)

ps:this game is called run aim fire look it up on you tube if you like it

I made a script that should do the trick:

var cam:Camera;

function Update()
{
    var x:float = Input.mousePosition.x - cam.WorldToScreenPoint(transform.position).x;
    var y:float = Input.mousePosition.y - cam.WorldToScreenPoint(transform.position).y;

    var zRotation:float = Mathf.Rad2Deg * Mathf.Atan2(y, x);

    transform.eulerAngles = Vector3(0, 0, zRotation);
}

Variable cam is the main camera you're using. Rest of it is just simple maths.

Assign the script to the arm of your character.

RDJ, thank you for posting this script, after searching for many hours and trying countless other scripts claiming to work which didn't, this did the job. You restored my faith in the community!

Once again like the other posts this works great for a 2d game, thanks!

Is there anyway that the angle returned could be between 0 to 360 instead of -180 to 180?