Fps game arm stretches when i look up or down

Hello. I’m trying to make an fps game. I want the arm to move up and down with the camera. I parented the arm to the camera but when i look down or up the hand stretches. Here is the script for the camera.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraControl : MonoBehaviour
{

public float sensitivity = 100f;

public Transform player;

float xRotation = 0f;

// Start is called before the first frame update
void Start()
{
    Cursor.lockState = CursorLockMode.Locked;
}

// Update is called once per frame
void Update()
{
    float mouseX = Input.GetAxis("Mouse X") * sensitivity;
    float mouseY = Input.GetAxis("Mouse Y") * sensitivity; 

    xRotation = xRotation - mouseY;
    xRotation = Mathf.Clamp(xRotation, -90f, 90f);

    transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
    player.Rotate(Vector3.up * mouseX);

}

}

Based on the images, I’m guessing that the parent GameObject to your “arm” has non-uniform scale. As a result, a rotated child under that parent Transform will become skewed.

The simplest way to deal with this is to have an empty parent object as your “base” with the “body” and “arm” as independent children under it, so their scale won’t influence each other.