# Setting rotation for an actor when it has been rotated

Hi

There are two things I don’t get:

Are you saying that when you change X, Y and Z change?

1. I can change the X, Y and Z or the directional light, without them affecting each other. When I change X, Y and Z stay the same. The only way I can imagine you have them linked together is if you have the light in a BP and the construction script is not empty.

2. Major point: Changing X does nothing. The X value does nothing to the light. The only two that affect it are Y and Z. You just need two sliders, one for Y and one for Z. That’s it

Sorry if this is frustrating, but I can’t see the problem… :-/

Hello :

I am back.

‘Are you saying that when you change X, Y and Z change?’
Yes! That is what I mean. And I don’t understand of how it works…
That is why I am looking for the mathematical formula…

You have to input the value into X or Y or Z first, and try to rotation the light in the ‘3D world’.
What if you only type the value into forms, that will not effect others that is for sure.

I wish to change the single value to make sun rotation, but how could I make the sun orbit tilt like the video I posted?

I am terribly sorry if I misleading the point from the beginning.
But do you have any idea to implement the sun working like the video?

Thank you so much…

I get it. Will come back…

Ok, this is it. Really simple. You can put the sun at any angle on any axis before you start and this code will let you effectively turn any of the handles just like you can in the editor. And it does all those ‘strange things’ to the other numbers. In this example I’m only increasing X, just like grabbing the X ( red ) slider in the editor…:

Hi :

Thank you…

That is quite simple, but after I tried this and I still can’t get the correct result… I made a video step by step and also post my BP script here.

In this video, I made X tilt first and try increased the Y value to make rotation.

Here is my BP screen shot.

BP text here.

Any thing wrong?? T-T

Thank you…

I tried your experiment exactly, this IS it working. Only the Y ( Pitch) is changing. When it gets to midday, the rotator switches, but that’s normal, the sun still continues on the correct course:

Hi :

Thank you so much for the help.

Good day.

.