How to prevent that my gameObject child, does rotate with my GameObject Parent

I need put gameObject child into a gameObject parent, but, my GameObject child doesn’t put rotate, I need that gameObject parent rotate, but just the gameobject parent, but the gameObject child is inside, the gameObject too rotate

put on child

function Update(){ transform.rotation.y = - transform.parent.transform.rotation.y;

//or //transform.eulerAngles.y = - transform.parent.transform.eulerAngles.y; }