Jump to content

Accessing time of day via code

Go to solution Solved by Bryan,

Recommended Posts


 I’m trying to find documentation on how to change the hour and minute in the weather setting via code. Can anyone point me in the right direction or pose some examples?

Link to comment
Share on other sites

You are going to want to tie into the GaiaGlobal with the public class GaiaTimeOfDay


Link to comment
Share on other sites

Thank you for the reply. Can you be more specific please or direct me to the documentation. I’m still developing my coding skills so I’m looking for a more detailed explanation or reference examples.

Link to comment
Share on other sites

  • Solution

int hour = 5; float minute = 40f; Gaia.GaiaAPI.SetTimeOfDayHour(hour); Gaia.GaiaAPI.SetTimeOfDayMinute(minute);

Hour is an int and minute is a float

You can also set the data block and tweak the other settings if you need to.
Here is an example of that.

Gaia.GaiaTimeOfDay tod = Gaia.GaiaAPI.GetTimeOfDaySettings(); tod.m_todHour = 5; tod.m_todMinutes = 40f; Gaia.GaiaAPI.SetTimeOfDaySettings(tod);

The GaiaTimeOfDay has the following settings: (bool)Enabled/(int)Hour/(float)Minute/(float)TimeScale. The starting time of day is no longer in use and will be removed.

Hope this helps in setting the time of day

  • Like 1
Link to comment
Share on other sites

Perfect! Thank you.

Is there similar commands for starting rain and other weather effects etc?

Link to comment
Share on other sites

There should be it will be just farther down in the API Script Code. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

  • Create New...