In my scene, I have a directional light which rotates based on a value (0f-1f). When that value is zero, I want the directional light to be pointed downwards, so I rotated the light to (90,0,0). After this it doesn’t matter how I try to rotate, it never goes the direction I want.
Actually, I’m so confused right now, I don’t even know how to explain my problem. It’s best to compare it to the sun. When the variable is 0f it’s noon; the light comes straight down. When the variable is 1f it’s midnight; the light goes straight up.
The lightobject should rotate around it’s own axes, not around another object.
how to do this?
EDIT
No idea if it’s of any importance, but when I let the light start with a rotation of 270 degree at the Y axis and I use:
transform.eulerAngles = new Vector3(Value*360 ,270, 0);