How to edit Procedural Sky real-time.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Rutherford

I want to have a day-night cycle using a procedural sky, but I am not sure how to get or set the value for the sun_latitude property. I read the documentation but I’m still confused on how to do it. I thought maybe sun.get_environment(ProceduralSky.get_sun_latitude()) would work but it errors out. How can I achieve this?

Thanks for the help in advance.

:bust_in_silhouette: Reply From: omggomb

get_viewport().world.environment.background_sky.sun_latitude is what you’re looking for I think. You could also of course use the environment property of any WorldEnvironment node you might have in the scene instead of get_viewport().environment

In Godot 3 most get/set methods are replaced by properties you simply read from or write to.