1

My project has a Light Source and a Sky Sphere Blueprint.

The rotation on the y axis (Light Source) defines the position of the sun (Sky Sphere Blueprint).

Character Blueprint (increases by 10 degrees on the y-axis rotation of Light Source, the updates the position of the sun):

enter image description here

When you click the button (Angulo, circled in pink), the angle increases by 10 and works to a certain moment:

enter image description here

Image with angle increased by 10:

enter image description here

When it reaches 100 degrees, it starts to go wrong. Each time I click the button it goes from 90 to 100 and vice versa in an infinite loop:

enter image description here

enter image description here

I've already tried to turn it around, subtracting instead of adding, but at one point it also gives error (in the case with 110 degrees).

Boneco Sinforoso
  • 651
  • 1
  • 19
  • 44

1 Answers1

0

Based on @DMGregory comment and also on his answer given in another question.

Question link where he gave the answer that helped me:

Why rotating an object only on its local X axis result in sudden 180 degrees changes in Y and Z axis rotation values

I stopped using the value coming from the rotation of Light Source. I have stored the desired value in a variable and set it directly in the rotation of the Light Source.

First I did a test using a switch and it worked:

enter image description here

To optimize this, I used a structure and a data table:

enter image description here

Boneco Sinforoso
  • 651
  • 1
  • 19
  • 44