Holding object in first person

Hello, I’m trying to have a player hold an object in front of him in first person, however, when I look up and down, the object appears to be getting farther apart than when looking straight forward, which does not look correct. Here is a video: wvu7wk and my hierarchy: Imgur: The magic of the Internet. If I am not mistaken, my cube should follow the main camera and rotate with it, so it should stay a fixed distance in front of it. Here is my player look script, which is attached to the camera:

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

public class PlayerLook : MonoBehaviour {
float INPUT_MULTIPLIER = 5.0f;
float xRotation = 0.0f;

public Transform playerTransform;

void Start() {
Cursor.lockState = CursorLockMode.Locked;
}

void Update() {
float mouseX = Input.GetAxis("Mouse X") * INPUT_MULTIPLIER;
float mouseY = Input.GetAxis("Mouse Y") * INPUT_MULTIPLIER;

float newXRotation = xRotation - mouseY;
xRotation = Mathf.Clamp(newXRotation, -90f, 90f);
transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f); 
playerTransform.Rotate(Vector3.up * mouseX);
}
}

I cannot seem to get it working. Any help is greatly appreciated.

Ok so… I think the movement is actually correct. But the really awful thing that’s happening is that the cube is actually skewing and scaling in strange ways! Look at that video! The thing is made of jello!

I’m pretty sure i know why that’s happening too:

Somewhere in that chain of Player → Camera → FirstPersonSocket → Cube, there is a transform that has a scale that is not (1, 1, 1). Most likely it’s the player itself!

It’s kind of bad form to have non-unit scaling on the parent object like that. And this video is a demonstration of why it’s bad. If you scaled the whole Player object to scale the cylinder… Undo that! Set the player’s scale back to (1, 1, 1), and scale the cylinder child itself! It will make everything a lot easier. Try to keep things unit-scaled as much as possible. I typically only keep non-unit scaling on “leaf” objects, which is basically the “babiest” child in the hierarchy. It avoids all kinds of nasty issues like this.