I'm creating a third-person game. I want the player-model to follow the rotation of the camera. I do that with this :
var camRotation = new Quaternion(cam.rotation.x, cam.rotation.y, cam.rotation.z, cam.rotation.w);
transform.rotation = camRotation;
The horizontal axis works fine, and the model turns with my camera, but the mode vertical axis also tilts up and down, which i do not want.
I've tried zeroing out the rotation.y and z, but this has some strange effects when I do.