Question by
edwardrmiller · Mar 04, 2016 at 03:48 PM ·
rotationquaterniontransform.rotationeuler angles
Mirror rotation of object along 2 Euler Axis'
I'm currently trying to mirror the rotation of one Game object based on the rotation of another game objects along 2 euler axis.
I'm struggling getting rotation working correctly without flipping out at 180 degree implements due to using Euler angles rather than Quaternions. This is the code I'm currently using. Could anybody please help?
float x = TopCamera.transform.rotation.eulerAngles.x;
float y = TopCamera.transform.rotation.eulerAngles.y;
float z = TopCamera.transform.rotation.eulerAngles.z;
transform.rotation = Quaternion.Euler(x, 0, z);
Comment