There is an error in this arm rotation script with mouse input, I did with youtube tutorials and despite being identical to the video the arm does not move and the input of the mouse does not change until I move the character, i assignthe mainCamera tag to my camera
public class ArmRotation : MonoBehaviour {
private 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);
}
}