I have a question about transforms in the Inspector view.
For example, I create a directional light. GameObject → Create Other → Directional Light.
And I zero out the position and rotation.
So now, the light should be pointing down the Z+ axis.
I then enter 45 degrees for Z rotation. Looks ok.
Then enter 45 degrees for Y rotation. Here, this rotation looks odd.
I’m expecting the light to point diagonally up, but instead it’s pointing diagonally straight
with no inclination. Why is this?
I would like a worldspace rotation of (0,45,45), but I’m not seeing that.
Here’s my script:
#pragma strict
function Start()
{
var lightObj : GameObject = new GameObject("Directional Light");
var light: Light = lightObj.AddComponent("Light") as Light;
light.type = LightType.Directional;
light.transform.position = Vector3(0,0,0);
var rotation = Quaternion.identity;
rotation.eulerAngles = Vector3(0,45,45);
light.transform.rotation = rotation;
}