Jump to content

Issue with GetTimeOfDaySettings in Gaia Pro 2023 (v4.0.5) - Always Returns Null


Go to solution Solved by Peter,

Recommended Posts

Issue originally posted by user @darthroxas12 in a different section of the forum:

Hello everyone on the forum,

I'm currently working on a project using Gaia Pro 2023, specifically version 4.0.5, and I've run into a quite frustrating issue. My goal is to create a dynamic where a third-person character goes to sleep and then wakes up during the day. The key here is that I want to achieve this without switching scenes, but rather by manipulating the day time directly.

The problem arises when trying to use the GetTimeOfDaySettings function from Gaia's API. Every time I call this function, it always returns null. Here’s the code I'm using:

 

GaiaTimeOfDay tod = GaiaAPI.GetTimeOfDaySettings();

if (tod != null) {

tod.m_todHour = 12;

tod.m_todMinutes = 30f;

tod.m_todDayTimeScale = 0;

tod.m_todEnabled = true;

tod.m_todStartingType = 0;

GaiaAPI.SetTimeOfDaySettings(tod);

}

else

{

Debug.LogError("GetTimeOfDaySettings returned null.");

}

 

I've verified that other methods from the API, like those related to Weather, work correctly. But for some reason, all methods related to TimeOfDay return null or zero.

Has anyone else experienced this issue? Or could anyone suggest what might be causing this issue with GetTimeOfDaySettings? Any help or suggestions would be greatly appreciated, as this aspect is vital for the gaming experience I'm trying to create.

Thanks in advance!
Darth Roxas 12

Link to comment
Share on other sites

  • Solution

Hi @darthroxas12,

I looked into this and found this is a bug in Gaia 2023: The way the time of day system handles / stores its settings was updated from Gaia 2021 to 2023 and the API was looking in the wrong spot for the settings. Please find attached a patch to fix this, after installing the included unitypackage via

Assets > Import Package > Custom Package...

the Time Of Day functions of the API should work again. Here is the patch:

GaiaAPITODHotfix.zip

Link to comment
Share on other sites

Hi Peter,
I really appreciate your Asset. Problem Fixed!

Thank you,
Darth Roxas 12

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...