simple rotation problem...

I’m truing to copy the rotation of the main camera and apply it to the player, but it seems to get strange in between some values 120-241(or so)…everything else works great…just wondering what I am doing wrong here is the simple line of code I am using…

transform.localRotation.y = Camera.main.transform.localRotation.y;

it doesn’t seem to matter if I use localRotate or rotate…
I am just using the code to set the players rotation into the scene so when I press w the camera is always behind him…for something so simple I do not understand why I am having problems :slight_smile:

transform is a quaternion so maybe try transform.localEularAngles.y and use transform.Rotate.
I haven’t tried this, btw. I don’t think you would need a local in that instance, either, but don’t know for sure.

thanks for the response…
this → transform.localEulerAngles.y = Camera.main.transform.localEulerAngles.y;
works btw…I should have looked up euler, but sometimes to use the api scripting reference you have to already know what you need??? kinda backwards that way. :slight_smile:
but this is solved ty.