Announcement

Collapse
No announcement yet.

Trying to rotate my sun

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trying to rotate my sun

    Hello everyone,

    I am trying to rotate my sun but it doesn't really work.

    When I rotate my sun (directional light), the light changes but the actual sun in the sky sphere doesn't move. Does anyone know how to fix this because it looks weird if it's night, yet there's a sun in the sky.

    Thank you in advance,

    Yaz

    #2
    I will move this thread into the bp section of the forum. -> take a look at the wiki, I think there you can find a day/night cycle tutorial which will explains how to change that https://wiki.unrealengine.com/Main_Page

    Comment


      #3
      YOu will have to rebuild the lightning for the actual "sun" to move. At least that's my solution. Ifyou're gonna change it's rotation ingame with a blueprint you have to get a reference to the SkySphere and "update the sun direction" on that one too!

      Comment


        #4
        Thanks guys, I'll try it out

        Comment


          #5
          Originally posted by fighter5347 View Post
          I will move this thread into the bp section of the forum. -> take a look at the wiki, I think there you can find a day/night cycle tutorial which will explains how to change that https://wiki.unrealengine.com/Main_Page
          Hey, I followed the wiki guide and I managed to create a day/night cycle, BUT when I manually try to rotate the sun it still doesn't work. The light changes appropriately, but the sun does not move along so it looks very weird still. :S Any idea on what I could do? Thanks man!

          EDIT: My work mate just tried to do it himself and it didn't work for him either. Could this be because of the recent update?

          Comment


            #6
            If you're using the default Sky Sphere Blueprint we included, notice that you have to hit the "Refresh Material" checkbox to update the sky in the editor. That's your giveaway - that means something needs to happen in order to update the sky.

            If you open that Blueprint, you'll see that there is a custom Function called UpdateSunDirection. Go into the Event Graph. Create an "Event Tick" node. Connect that to an UpdateSunDirection function call. You could put a delay on this for performance reasons, especially if your sun moves slowly (as it probably should). Now, if you animate your Light Source (make it moveable!!), the material sun will always move with it.

            This is super fast to set up. Give it a try and let me know how it works.

            EDIT: Oh, and before I forget, unless you use Delta Time from the tick to help control how much you rotate, then your sun will probably speed up and slow down based on hardware performance! You may or may not notice that depending on how fast the sun is moving, but it's worth a mention.
            Last edited by ActualZak; 04-25-2014, 11:55 AM.

            Comment


              #7
              FYI, unlike UDK, the visible sun in the sky is actually separate from the lamp, it's a just white disk shape on the sky's material. The sky material/blueprint is cleverly designed to position this disk using the sun's rotation. As Zak said, the material won't update unless you press that box.

              I've got a tutorial/template related to this kind of thing here, in case you're interested.
              Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

              Comment


                #8
                Originally posted by Zak Parrish View Post
                If you're using the default Sky Sphere Blueprint we included, notice that you have to hit the "Refresh Material" checkbox to update the sky in the editor. That's your giveaway - that means something needs to happen in order to update the sky.

                If you open that Blueprint, you'll see that there is a custom Function called UpdateSunDirection. Go into the Event Graph. Create an "Event Tick" node. Connect that to an UpdateSunDirection function call. You could put a delay on this for performance reasons, especially if your sun moves slowly (as it probably should). Now, if you animate your Light Source (make it moveable!!), the material sun will always move with it.

                This is super fast to set up. Give it a try and let me know how it works.

                EDIT: Oh, and before I forget, unless you use Delta Time from the tick to help control how much you rotate, then your sun will probably speed up and slow down based on hardware performance! You may or may not notice that depending on how fast the sun is moving, but it's worth a mention.
                Thanks for the reply!

                I tried ticking Refresh Material, but it didn't work for some reason?

                I have also done the tutorial by Tesla on time of day in UE4, and it works. The sun rotates slowly as time passes, but still, I cannot rotate it the way that I want. I am not sure if that is what you meant me to do, because if yes, then I've tried it already :/

                Comment


                  #9
                  Originally posted by gregdumb View Post
                  FYI, unlike UDK, the visible sun in the sky is actually separate from the lamp, it's a just white disk shape on the sky's material. The sky material/blueprint is cleverly designed to position this disk using the sun's rotation. As Zak said, the material won't update unless you press that box.

                  I've got a tutorial/template related to this kind of thing here, in case you're interested.
                  Thank you, I think I'll give that one a shot if the thing I'm working on right now doesn't work out in the end. Cheers!
                  Last edited by siryazan; 04-28-2014, 04:57 AM.

                  Comment


                    #10
                    Newbie question. How do I remove the sun? I realized after the fact I should have chosen the blank blueprint, but now I just want to remove the sun so I can have lights that actually work in my top down. Thanks for the help

                    Comment


                      #11
                      Originally posted by RobertJS3 View Post
                      Newbie question. How do I remove the sun? I realized after the fact I should have chosen the blank blueprint, but now I just want to remove the sun so I can have lights that actually work in my top down. Thanks for the help
                      Deleting the directional light in the level should do the trick. Just make sure you rebuild lighting afterwards.

                      EDIT: Actually that doesn't seem to work. I think you need to edit the sky material to remove the sun disc part.
                      Last edited by gregdumb; 04-28-2014, 03:19 PM.
                      Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

                      Comment


                        #12
                        Ok I will try editing the sky material. Thanks

                        Comment


                          #13
                          Originally posted by Zak Parrish View Post
                          Zak Parrish. notice that you have to hit the "Refresh Material" checkbox to update the sky in the editor.
                          Doesn't work for me in the installed UE4 4.5.1 However in the Github Built latest engine it does work. I think there is a problem with a specific update. should get it fixed cause its one of the first things noobies try to do by themselves, and is a great self esteem blow if something doesn't work on the very beggining.

                          Comment


                            #14
                            Zak, Thanks for the tip on this. This work and updates in game for me, but I would like to rotate the light in the editor and have the sun auto update while (or after) rotating the light. I added the refresh button and that works, but it is kind of a pain to always re select the blueprint and then hit the button every time you move the light. Any help on this would be great! Thanks.

                            Comment


                              #15
                              Hello

                              I am trying to rotate a sun following the unreal tutorial. The sun rotates and I didn't create a class BP. I just want the sun to rotate after the player enter a trigger zone. Only problem, the sun rotate from another location that its default location from where I placed it (zenith). After placing the BP skysphere that I am using, I modify the sun height to 1 value so the sun it's at the zenith. However, it's start its rotation from a lower location. Any advice how to fix this? I believe it's a getting and setting location problem? Or get a sun heigh variable? kinda lost here. Thanks for the help

                              Comment

                              Working...
                              X