Announcement

Collapse
No announcement yet.

Update Sun Direction Error

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

    Update Sun Direction Error

    I get errors when I call the Update Sin Direction Method from the SkySphere:

    Blueprint Runtime Error: Accessed None trying to read property Directional light actor from function: 'UpdateSunDirection' from node: Set Vector Parameter Value in graph: UpdateSunDirection in object: BP_Sky_Sphere with description: Accessed None trying to read property Directional light actor

    Blueprint Runtime Error: Accessed None from function: 'UpdateSunDirection' from node: Set Vector Parameter Value in graph: UpdateSunDirection in object: BP_Sky_Sphere with description: Accessed None

    Blueprint Runtime Error: Accessed None trying to read property Directional light actor from function: 'UpdateSunDirection' from node: Set Sun height in graph: UpdateSunDirection in object: BP_Sky_Sphere with description: Accessed None trying to read property Directional light actor

    Please help, I am trying to make a Day/Night cycle




    #2
    Assuming you are using one of the standard templates with a BP_Sky_Sphere, the proper way to create a day/night cycle is:

    1. change the Pitch (Y) rotation of the Light Source representing the sun to set the proper time of the day/night. The classical way is to add a bit of pitch at every Tick, but you can also use a timer or some other method. If you use the Event Tick method, remember to multiply the base pitch variation by World Delta Time to take into account variations in the frame rate
    2. once the pitch for the sun Light Source has been modified, invoke Update Sun Direction for the Sky Sphere so the sky representation is updated according to the height of the sun

    Make sure you make the Light Source representing the sun Movable so its rotation can be modified via Blueprint
    CTO | Head of VR Development - Visit us at http://humanxr.com
    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

    Comment


      #3
      Yes, a very late answer from the future : I got same issue. Solution : in your sky sphere, at directionnal Light Actor you have to select your directional light.

      Comment


        #4
        "Accessed None trying to read property Directional light actor"
        Or "hey did you forget to tell the sky sphere what light it's supposed to use as the base for positioning the sun disc?"

        Also while on the subject. DO NOT modify the sky sphere. Create a copy (a hard copy) or instance a child to make modifications, so that the rest of your projects won't be affected.

        and
        You have to manually loop the sun around back to 0 after 360deg because of gymbal locking.
        Tick * sun speed = SunAngle - if sun angle >360 sun angle 0.
        Last edited by MostHost LA; 11-22-2019, 11:31 PM.

        Comment

        Working...
        X