Rotating a child and a parent, simultaneously

I´m going crazy…

I have two rotation, which workd well independently, but together they have a really wierd behaviour.

The child is:

at.rotator.transform.localRotation = Quaternion.AngleAxis(curAngleZ, at.rotator.forward * -1) * start;

The parent is:

temporaryObjectForRotationOnYAxis.transform.localRotation = Quaternion.AngleAxis(temporaryObjectForRotationOnYAxis.transform.localEulerAngles.y + mouseDragX3, temporaryObjectForRotationOnYAxis.transform.up);

And it does not work. it, goes all crazy, with rapid and umpredictable behaviour. I even tried changing it to euler angles… Still the same behaviour…

Any Ideas on how should I tackle this problem?

Thank you.

Local rotation is in local space. So using at.rotator.forward makes no sense as this gives you the forward axis in worldspace. You might want to use

at.rotator.transform.localRotation = Quaternion.AngleAxis(curAngleZ, -Vector3.forward) * start;

However it depends on your actual setup. Also

it does not ork

Is not a useful description of what happens or what would you expect.