- Home /
Question by
imeveryman · May 25, 2020 at 04:03 PM ·
camerarotate object
Rotate object with camera
I'm making 3rd person shooter and i want to rotate object with camera. The idea is to only change Y rotation. Camera movement is controlled by the mouse. I've tried to use this little formula:
player.rotation = Quaternion.AngleAxis(Input.GetAxis("Mouse X") * turnSpeed, Vector3.up);
But, surprise, surprise! It doesn't work!
If i make camera a child of an object - nothing changes.
If i make object a child of a camera - it goes into the sky.
Comment