I was trying to create an automatic day-night cycle so I set up a small world in which there’s only a boxbrush, a directional light actor and a native skysphere blueprint. I set the directional light to be used by the skysphere as the light I placed and played around with its rotation a little.
Changing its pitch (Y-axis) fully around to 360 degrees turns it back to 0 degrees rotation, as expected. The sun followed through the sky.
However, creating the blueprint to automate the process, I ran into a problem. Here is what I created in the Level Blueprint:
The thing is that the range of the pitch here doesn’t want to exceed +90 or -90. Lower than -90 will turn the pitch into 0 + the amount below -90. Higher than 90 will trip the pitch up and turn it instantly back to 90 less than half a second later.
Using higher values for the ‘add 10 degrees to the pitch’ integer box on the left will make the pitch jerk further than 90 more and more, but will still make it revert to 90 instantly.
Could you help me with this problem? I do not understand why there is only half of a circle available for the full rotation, since I can manually adjust the light in the direction I want it to within the editor - the problem is the blueprint. Maybe I need to use another rotation method?
Would you happen to know why my pitch was constraint so strangely between these two values giving me a range of 180 degrees only? Why can I not animate in the full 360 degrees of motion from within a Blueprint?
No, and I’m still not certain why not. With the links provided, I was able to create the day-night cycle fine, but not using the method I was originally planning to use. I don’t know why pitch is constrained like that exclusively in the Blueprint editor; the people from Epic didn’t reply further - maybe it’s a bug.
We have been investigating some scenarios in which rotations aren’t working as expected with blueprints, but don’t have an ETA for a fix, unfortunately.
One blueprint setup we have been able to use to create a day/night cycle is using a Timeline that modifies your directional light’s rotation with a Set Actor Rotation node. You can setup a float in your timeline that goes from 0 to 360 (or 0 to -360, depending on which axis you’re rotating around) and control how quickly it does that rotation within the timeline itself. If you would like an example of what that would look like in a blueprint, let me know and I’ll provide a screenshot.
Still “broken” in 4.21 as well.
It acts pretty randomly with sun rotation - following this tutorial
Set the sun speed to 1, it gets stuck at 90.
Implementing the Sun Angle option mentioned above is actually slightly better in terms of figuring things out though, so while this is a bug, the work-around is actually beneficial to advanced coding/scripting…
including a quick snapshot of how this changes with that.
HOWEVER, I have a really easy permanent fix for this. The solution: rotate the sun on a very slight angle that no one would ever notice. Set the starting rotation of the directional light tied to your sky sphere to (1.0, 88.0, 1.0) or similar numbers. This will force the sun to rotate on a slight angle and it will never be able to hit 90 or -90 in pitch.