Why can't I assign a rotation to a rigidbody Object?

I have a character completely made out of parts, with rigid bodies and joints. I am trying to assign the rotation of the LowerTorso to the rotation of the Camera. It is not working. What am I doing wrong?

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

public class LowerTorsoRotation : MonoBehaviour {
    public GameObject Camera;
	// Use this for initialization
	void Start () {

	}
	
	// Update is called once per frame
	void Update () {
        transform.rotation = Quaternion.Euler(transform.rotation.x,Camera.transform.rotation.y,transform.rotation.z);
	}
}

You have to set the rotation with Rigidbody.rotation.


Something like this:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class LowerTorsoRotation : MonoBehaviour {
     public GameObject Camera;
     private Rigidbody rigidbody;
     // Use this for initialization
     void Start () {
         rigidbody = GetComponent<Rigidbody>();
     }
     
     // Update is called once per frame
     void Update () {
         rigidbody.rotation = Quaternion.Euler(transform.rotation.x,Camera.transform.rotation.y,transform.rotation.z);
     }
 }