I have a day and night cycle but when the moon reaches 24(midnight) then it suddenly resets the rotation to the 0 position. how can i change this so that the moon rotates to the 0 position?
the same thing happens with the sun at the highest point it suddenly flips on the rotational z 180 degrees. but you just cannot see it because it has no texture
So I’m not going to wire all this up and test it, but I certainly have had problems with rotations and Unreal making the equivalence that -180 = 180, that -10 = 350, etc.
So can you try adjusting your ranges, instead of 0 to -180, and -180 to 0, doing 360 to 180, and 180 to 360?
Hey i tried it but it is the same at the half point the directional light suddenly turn to negative.
i made a new blueprint with only sky atmosphere and a directional light an on the light with the property Forward Shading Priority on one, i changed nothing else.
then i just made a float with the range of 0 to 24 and the following components that fire from the constructor script :
I’m not sure what the problem is, but I still think one problem is your range of 0-24 mapping (now) to 180 to 360; if your value rolls over from 24 back to 0 at midnight, the rotation will snap back to 180.
The other thing is I feel like you shouldn’t be “adding” instead of “setting” the world rotation.