Items looking smashed when crounching

Hey guys! I’m coding my player’s crouching and my player is holding an object (which is a child). When he crouches the object looks smashed as the code works by changing the player’s Y scale. Is there any I can rearrange the hierarchy or the code, so the item doesn’t look funky?

 // start crouch
        if (Input.GetKeyDown(crouchKey))
        {
            transform.localScale = new Vector3(transform.localScale.x, crouchYScale, transform.localScale.z);
            rb.AddForce(Vector3.down * 5f, ForceMode.Impulse);
        }

        // stop crouch
        if (Input.GetKeyUp(crouchKey))
        {
            transform.localScale = new Vector3(transform.localScale.x, startYScale, transform.localScale.z);
        }

You change the weapon’s localScale to the inverse of that of the parent. If parent’s new y is .5, the weapon needs to be 2.

 if (Input.GetKeyDown(crouchKey))
        {
            transform.localScale = new Vector3(transform.localScale.x, crouchYScale, transform.localScale.z);
            weapon.transform.localScale = new Vector3(transform.localScale.x, inverseCrouchYScale, transform.localScale.z);

            rb.AddForce(Vector3.down * 5f, ForceMode.Impulse);
        }

        // stop crouch
        if (Input.GetKeyUp(crouchKey))
        {
            transform.localScale = new Vector3(transform.localScale.x, startYScale, transform.localScale.z);
            weapon.transform.localScale = new Vector3(transform.localScale.x, inverseStartYScale, transform.localScale.z);
        }