# The direction light has a strange behavior when I change its rotation

Hi
I have a problem related to the rotation of an object (direction light)
The problem can be found in the video. The direction light (gameobject) starts to have a strange behavior (rotation).
It is a single line of code: `transform.rotation = Quaternion.Euler(360f * (time / 24f) + -120f, transform.rotation.eulerAngles.y, 0f);`

It is a very bad single line of code.
If you are rotating over a single axis, why complicate matters so much?

Assuming that `time` is a value between 0 and 24

``````transform.rotation = Quaternion.Euler(360f * time / 24f, 0f, 0f);
``````

Also try using localRotation instead, and please don’t use eulerAngles if you don’t know what you’re doing. You can at least read about it in the docs, because it is very well explained, what is the reasoning behind it, when they work, when they don’t work, and why is the mathematics as it is.

Basically Unity doesn’t like angles. Angles are bad, they smell bad, and they snore at night. If you still love them, and we all do sometimes, use Euler method and/or learn how to use quaternions.

I also want to change the value of Y.

``````transform.rotation = Quaternion.Euler(360f * (time / 24f) + -120f, transform.rotation.eulerAngles.y, 0f);
transform.Rotate(0f,1f,0f);
``````

But when I try to do it, it starts to behave very strangely. You are right about the angles in Unity…