I want a camera to be a child of my player but not to follow it's rotation

Now, as noobish as this question seems, I could not find an answer. I need my camera to be a child of my player, and follow it around but not rotate. Now, I know how to make a script that makes your camera follow the player, but that works only if the camera is not a child of my player. I want my camera to be a child of my player because I’m doing networking stuff and I need the player and camera to be one gameObject, but I can’t make a new empty gameObject because I need my player to be the root parent. Does anyone have a Idea of what I could do? ps. adding a rigidbody to the camera and making the camera kinematic or freezing it’s rotation doesn’t work

I don’t see why you can’t have your script that makes the camera follow the player work on a child of the player. Can’t you do

void Update() { gameObject.transform.position = gameObject.transform.parent.transform.position; }

and have the camera as a child following the parent GameObject? (note: not tested)

Have you seen the answer on the URL below?