My arm wont follow my mouse.

I am trying to make a Platformer/Shooter game, and so i want to make my arm follow my mouse so you can aim to where you are shooting. But this is a problem, my arm does move… but not with my mouse exaclty. It’s difficult to explain. I am using this script for the arm rotation…

using UnityEngine;
using System.Collections;

public class ArmRotation : MonoBehaviour {
	public int rotationOffset = 90;

	// Update is called once per frame
	void Update () {
		Vector3 difference = Camera.main.ScreenToWorldPoint (Input.mousePosition) - transform.position;
		difference.Normalize ();
		float RotZ = Mathf.Atan2 (difference.y, difference.x) * Mathf.Rad2Deg;
		transform.rotation = Quaternion.Euler (0f, 0f, RotZ + rotationOffset);
	}
}

I’m not sure what to do, please help.
(P.S. I am new to both the C# code, and Unity, so this might be a very easy fix, I don’t know.)

If you game is 3d Your problem might be the parentage of the arm
The arm needs to be a child of the camera
The standard assets character scripts are good for beginners
Just child your arm model to the camer and game on
I hope this helps

i have an idea that you don’t even need scripting in it. if you are using the character package import it should work, CHARACTER package, which is first person you should attach the arm to firstpersoncharacter and test it. You should be able to move the mouse with the arms. if it doesn’t work, let me know.

her is a early picture of my game which is a shooter/survival game.

another one is here

NO REMODELING DID HERE EXCEPT FOR MATERIALS… ALL DID IN PLAY MODE

                                                                                                                                                       sincerely,
                                                                                                                                thatonecoderwhoisawesome