Trying to setup a world where the sun rotates around the world without ever setting. When I add the rotator to the directional light though I can’t get it to rotate on a horizontal plane, it always dips below the horizon and I get a night cycle I don’t want.
Hopefully not too difficult but I’ve been tearing my hair out over it. Help is appreciated.
So… …if I have a game and I look straight up and watch the sun, you want it to, essentially, be rotating in a circle. Yes?
I wanted day and night transitions so I have three things rotating in the sky: sun, moon and stars.
Regardless, I have these items managed both in the persistent level and the game mode. I have a dispatcher which links the system together to address issues/challenges switching from night to day and day to night.
I have the position of these items stored in the game mode.
I have a 500ms timer in the game mode that is incrementing a Y-axis position variable for these actors. If you watch the sky actors, the action is not smooth at 500ms; however, I believe it is sufficient for my needs.
I have another timer in the persistent level which reads the gamemode variables and applies them to actors via SetActorRotation.
I suppose an equation could be created and applied to SetActorRotation to cause the sun actor to rotate above the terrain without setting.
I claim this should work.
With the old SysphereBP all you have to do is use a different axis on your directional light.
Realistically, you probably want to compute fhe rotation given a declination and a right ascention.
It may be faster to set up the sun position calculator at one of the 2 poles, and set the time to when its daylight (6 months of each day/night).