Changing directional light colour based on rotation

Hi folks, as the title suggests I’d like to Change the colour of a directional light based on its rotation.

I’ve got a slowly rotating directional light using BP and as it rotates I’d like it to change colour. I don’t think I can do it with a timeline as The player has the ability to press a key that rotates the light around.

Does anyone have any ideas on how to do this?

P

are you trying to do it randomly, in a pattern, or based upon rotation direction?

Hi Nuclear, thanks for your reply. I’m making is a sun that orbits a planet and I’d like the light
to be yellow when the sun is low over the planet and gradually change to white as the sun gets higher and go back to yellow as it gets low again.

So based on rotation direction.

in the actor blueprint you’re going to need to get the actor’s rotation and then use set light colour. you’ll also need to evaluate the rotation to select which colour the light is and that’s both the harder part and the part i’m not sure about. get actor rotation gives you three vectors (you can break them out with break rot into axes) but i haven’t done with vectors to know how to compare them.