Rotate parent to face forward relative to a child along local y

I’ve been pulling my hair out trying to figure out how to do this. I have a spherical terrain using faux gravity scripts. the player moves around the terrain just fine, with its feet always pointing towards origin. There is a camera as a child of the player, which i want to work similarly to the 3dbuzz third person controller scripts. The camera can orbit around the player, and works just fine. now what I’d like to do is to have the player face the direction that the camera is facing, so that i can “steer” by moving the camera around the player. I must be mixing up local vs world coords here, i just cant figure this out.
I’ve tried this

myPlayerGO.transform.rotation = Quaternion.LookRotation(myPlayerCameraGO.transform.forward, myPlayerGO.transform.up);

and also this (this is what im using in the video)

			myPlayerGO.transform.eulerAngles = new Vector3(0,myPlayerCameraGO.transform.eulerAngles.y,0); 

and many other variations

the players up direction becomes global up, which is not at all what i want.

Here’s a pastebin of a larger section of my code (if you need more just ask, i tried to just pick out relevant parts) Vector3 gravityUp = myPlayerGO.transform.position - new Vector3(0,0,0); grav - Pastebin.com

you can see how the skybox is orientated with global y up, and how the player is also. the player looks in the right direction, but just loses its orientation.
a video of what is happening: - YouTube

I don’t understand Quaternions, i’ve been watching lectures and reading all day and no matter what i try i can’t figure this out. How can i rotate the player to face the way the camera is facing (like in vid) but without throwing off its orientation to the origin? Its gotta be something with local vs world that im not getting…

I figured it out :smiley: kinda went in a different direction than what i was doing. Thanks to rutter for pointing out the parenting thing. What im doing is using rotate around to rotate the camera around the player, and transform.rotate to rotate the player itself. When the player isnt supposed to be rotating, but the camera is, i add up the difference and then rotate by that, so that the player’s rotation always lines up.
here’s a pastebin to the code that did it: Vector3 gravityUp = myPlayerGO.transform.position - new Vector3(0,0,0); gr - Pastebin.com