Jump to content

Usage of GaiaAPI?


Thomas123

Recommended Posts

Another question. This time it's about changing the time and weather by script. I found a script called "DemoAPIController.cs" in Gaia Pro.

I attached this script in hope that I would be able to control the weather and time of day. But the script does not seem to pick up GaiaTimeOfDay. Thus it won't work. I did the following:

- Added Gaia Runtime to the scene
- Added a custom controller (references the controller)
- Added a empty Object and added "DemoAPIController.cs" to it

When I start the Scene, Gaia Sky is functional and I can change the the Lightning Profile from Day to Night (in Gaia Lightning). But the Demo script won't change anything.

 

How can I change the (Gaia) time of day by script? Could you provide a short example?

 

Using 2022.3 and URP.

Link to comment
Share on other sites

Hello, 

I would take a look at this: 


Then In the GaiaAPI.CS 
You will find the code for you and what you are looking for is line 35 and Line 255. 
That should be everything you need. 
 

Link to comment
Share on other sites

I couldn't get this working yet. I will post a snippet as soon as it works 🙂

For anyone who want's an easier solution during design time, I recommend setting up a custom Lightning Profile with Procedural Worlds Sky. There you can change the time by slider. This tutorial helped me a lot: 

 

  • Like 1
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...