Euler angle question

Hi! I have this simple formula, setting euler angle:

 Debug.Log("Eugelar in?" + RotX[j]+" " + RotY[j] + " " + RotZ[j]);
 Planes[j].transform.eulerAngles = new Vector3(RotX[j], RotY[j], RotZ[j]);
 Debug.Log("Eugelar out?" + Planes[j].transform.eulerAngles);

—in: 45, 0, 0
Eugelar in?315 0 0
Eugelar out?(315,0, 0.0, 0.0)

—in: 270, 45, 0
Eugelar in?270 45 0
Eugelar out?(270.0, 45.0, 0.0)

—in: 270, 45, 45
Eugelar in?270 45 45
Eugelar out?(270.0, 90.0, 0.0)

I know that I can not rely on Unity eugelar output values, but what I get is just nonsense. I never hav actual rotation around Z value. It just rotates object around Y. I tried commenting that line, thinking that maybe somethign else in my code affects it, but seems like this is the only line of code doing rotations. How come? I remember I had it working long ago, maybe somethign changed within Unity 4?

When I set Y to some value like 45, Z sunndenly stars working too. Actually just now I realized it has something to do with not using local eugeler angles. Probably I’m setting global coords though still an’t wrap my head around it, why it is working that. In docs I see that rotation has order (z,y,x) but don’t know whta is means

Yai: this fixed that
Quaternion rotation = Quaternion.AngleAxis(RotX[j], Vector3.right) * Quaternion.AngleAxis(RotZ[j], Vector3.forward) * Quaternion.AngleAxis(RotY[j], Vector3.up);

I’m positive those eulers has something to do with angle order, wish I could understand it, but well black box scenarion will work for a while :slight_smile: