Jump to content

HDRP Time of Day object reference issues with Unity 2022.3.5f


Recommended Posts

I have run into some object reference not set issues when trying to use Gaia runtime with Procedural Worlds Sky (and thus Time of Day). My full configuration is:

Unity 2022.3.5f1

HDRP 14.0.8

Gaia Pro 2021 v3.4.0

HDRP Time Of Day v1.2.0

and am working through the stamping tutorial at:

and when it comes to the point of spawning the biome and then setting up the player to explore, i choose third person, procedural worlds sky, and other options - and i get an "Object reference not set to an instance of an object error" at line 3637 of HDRPTimeOfDay.cs - which is strange as i had this working previously the other day.

 I went through the entire install process from scratch and checkpointed with Unity Version Control (PlasticSCM)  created an example scene with Procedural Worlds Sky selected from the run-time with third party camera. Worked fine, checkpointed, closed project, open projected , and the unreferenced object error appeared in the console. I tided with Unity Version Control Undo to make sure it's clean and should be exactly the source snapshot when i closed - still the unreferenced object error persists and won't play. This is the Unity 2022.3.5f1 configuration referenced above.

And another data point... i went through all the steps above (modulo the checkpointing) - back on 2021.3.20f1, and it worked. That is, got TimeOfDay working with the Procedural Worlds Sky option in the Create Runtime - closed project - opened project again, and there were no unreferenced object errors.

Soooo.... this would appear to be an issue with Time Of Day working with the latest LTS Unity environment? (Unity 2022.3.5f1)



Link to comment
Share on other sites

An update, i tried to back-off to the previous major version with configuration:

Unity 2022.2.21

HDRP 14.0.7

Gaia Pro 2021 v3.4.0

HDRP Time Of Day v1.2.0

And the same issue persists wherein i have an object reference not set to an instance of an object error at line 2760 of HDRPTimeOfDay when i close and reopen the project (works when i close the project with no error - and error appears in console upon opening the project and in trying to run the project the third party controller is frozen at play - and more object reference errors thrown).

Note - the CloudPresets volume edit was made per the post at:

Perhaps the steps i am taking are not correct - so, to be specific, once i have HDRP and shaders installed via the first panel in Gaia Manager, i go through the steps in the Gaia Manager panels:

  • On create world panel, choose terrain medium, powerful desktop, coniferous forest, with world designer - then create world designer
  • Generate World in the world designer inspector with defaults
  • Spawn Biome in Coniferous Forest Biome with defaults
  • Create runtime with third party controller, procedural worlds sky, and the rest with default options

These two examples (this reply and previous post) involve no other packages or code other than installing Gaia Pro and TOD with a different unity editor. And unfortunately, this is a pretty solid blocker with non-trivial cycle-time to run each of these tests. Any suggestions on what we should be doing differently or if there is another version of the Unity editor other than 2022.2 or 2022.3 that we should be using with Time of Day?

Link to comment
Share on other sites

Debugging this a bit, i seem to get two lines where there is a null reference. line 3049 in HDRPTimeOfDayProfiles.cs - where the m_weatherProfiles being looped over are all null and causes the null reference error.

And on line 2760, the m_timeOfDayPostFxProfile is null.

Looks like these lines relate to Screen Space Ambient Occlusion performance options and a weather power values reset. So, i tried the kludge of commenting them both out. I got the errors to stop, however, when i then started to build a scene with terrain elements and biome and tried to run with third person and procedural worlds sky, many other errors cropped up - again, object reference not set to an instance of an object.

I've rebuilt the project only using Gaia - and it's native ToD features.

Configuration is:

  • Unity 2022.3.5f1
  • HDRP 14.0.8
  • Gaia Pro 2021 v3.4.0
  • HDRP Time Of Day v1.2.0

This actually seems to be working so far on 2022.3.5f1 (no null reference issues, close/open project just fine). This Gaia native solution has most of what i need. So for now, although interested in the stand alone Time of Day solution, i've had to uninstall it as i can't progress development with the issues outlined above. Please let me know if we are not using this component correctly or if there would be another version of the unity editor more appropriate to use with stand-alone Time of Day. In the interim, we'll focus on the native Gaia Time of Day solution, which is very comprehensive, to progress our development.

Link to comment
Share on other sites

Thank you for this info we will be taking a look into this! 


Link to comment
Share on other sites

Many thanks! Let me know if i can provide any more information to help troubleshoot.

Link to comment
Share on other sites

  • 3 months later...

Did this ever get followed up on by the Devs, HDRP Time of Day seems to still not work with Unity 2022.3.11f1, and Gaia Pro 2021. I saw many other threads they haven't followed up on since September.

Link to comment
Share on other sites

Thanks for pinging on the topic. I was able to use a ToD-like feature in Gaia Pro 2021, wherein you could move a slider and the ToD lighting would change accordingly over a 24 hour period from day to night and back - with nice sunset/sunrise transitions. I've just loaded Gai Pro 2023 to see if a similar functionality exists - i have not been able to find it yet. The runtime system allows you to choose between different times of day (snapshot below) - and indeed, the volume management and post-processing is lovely. And i can move the sun and moon to different parts of the sky and create sunsets and moonrises this way. But i don't see a similar 24 hour slider tool that existed in Gaia Pro 2021 or the stand-alone ToD component that allows you to move between day/night dynamically. I may be looking in the wrong place and would have to defer to Procedural Worlds colleagues whether a similar ToD system exists in Gaia Pro 2023 or this is something we'll have to assemble manually with rotations and volume transitions.




Link to comment
Share on other sites

We are looking at this, currently, all hands are on deck for our new tech getting announced at Unite. 

Link to comment
Share on other sites

  • 3 weeks later...

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