Use Quaternion.Euler and Quaternion.eulerAngles . Note that the order for the Euler function is z, x, and y, unlike Vector3. EulerAngles returns the angle in degrees (whereas rotation.x returns the number of quaternions for this axis). The Euler function expects an angle, so you want something like:
Quaternion rot = GvrController.Orientation; transform.localRotation = Quaternion.Euler(rot.eulerAngles.z, 0, 0);
Depending on how the axes of your controller are configured, you may need to experiment with different orientations if it is not y-up z-forward, for example.
transform.localRotation = Quaternion.Euler(rot.eulerAngles.x, 0, 0);
or
transform.localRotation = Quaternion.Euler(0, 0, rot.eulerAngles.z);
etc. It should soon become clear which system it uses.
In addition, if the steering wheel is not a parent, use rotation instead of local rotation.
source share