Hi,
during some events I need to attach the camera to different nodes in the characters hierarchy. The camera does not need any local transformations since the parent GameObjects are transformed appropriately. The code is pretty simple:
cameraTransform.parent = mSomeCameraParent;
cameraTransform.localPosition = Vector3.zero;
cameraTransform.localRotation = Quaternion.identity;
cameraTransform.localScale = Vector3.one;
If I reposition the camera by using this code I get the following error message:
transform.rotation of 'Preview Camera' is no longer valid, due to a bad input value. Input rotation is 0.627494, -0.524879, -0.436318, 0.374675.
UnityEditor.DockArea:OnGUI()
Any ideas how to fix it? I found a similar thread http://forum.unity3d.com/threads/63630-Rotation-no-longer-working?highlight=transform.rotation+%27Preview+Camera%27+longer+valid%2C+due+bad+input+value.+Input+rotation in which it is written that closing and reopening the scene tab resp. closing Unity could solve the problem. But that did not work for my bug…