Jump to content

Gaia doesn't seem to see terrain data, causing runtime errors


aldaluin
Go to solution Solved by aldaluin,

Recommended Posts

Gaia Pro 3.4.1 on Unity 22.3.9 with BRP and a custom controller (Eadon Character Controller + Cinemachine).

At start of run (x3):

Updating terrain wind settings had a issue Object reference not set to an instance of an object This came from   at Gaia.ProceduralWorldsGlobalWeather.UpdateTerrainWindSettings () [0x00018] in /home/charlie/projects/jacals/FastJac01/Assets/Procedural Worlds/Gaia/Gaia Pro/Weather/VFX/Scripts/ProceduralWorldsGlobalWeather.cs:3196 

Every frame:

NullReferenceException: Object reference not set to an instance of an object
Gaia.GaiaScenePlayer.Update () (at Assets/Procedural Worlds/Gaia/Scripts/Scene Managment/GaiaScenePlayer.cs:118)

Neither of these make sense to me.  They both refer to Terrain.ActiveTerrains[?].TerrainData, which I thought came straight from Unity.  I only have one terrain in the scene and only one scene in the project.  Can you point me in the right direction? 

Link to comment
Share on other sites

@aldaluin I checked those error messages, and it looks to me as well like the terrain.terrainData seems to be missing. Normally this is created & managed as part of the unity terrain object, but from past support experiences we have seen cases where the terrain lost its reference to the terrainData object, or where the terrainData object was deleted from the project hierarchy.

Can you please check for the affected terrain if it still shows a valid reference to the terrainData object when you switch the inspector into Debug mode?


image.png

If there is no Terrain Data object, can you please check if it is still part of the project hierarchy? If the terrain was created by Gaia, the Terrain Data object can normally be found in the Session folder associated with the scene:

image.png

If it is still there, you should be able to restore the reference by dragging the Terrain Data object into the slot on the terrain while the inspector is still in debug mode. If it is missing entirely it is a bit difficult to say where it went - Gaia does normally only delete the terrain data when creating a new world from the world designer & deleting the old world in the process.

Link to comment
Share on other sites

@Peter This is what confused me in the first place.  The Terrain Data reference is there, and the splatmaps in the asset look good.  Exactly where you (and I) expect it.

@Bryan Yes, I'm trying to do it properly this time (see image).  But when I update the runtime it says the terrain data is missing!Screenshotfrom2023-10-0917-23-13.thumb.png.350eb3a5b40d82345785bb74539c164f.png

Let me see what I can find...

Nope, still no clue - that's just reiterating the original problem.  Code doesn't think the terrain data is there even though the Inspector is certain that it is. 

I'll try a clean project to see if I can find a workflow error, but I have too much (non-Gaia) time in this scene to let it go and start over.  The only other thing I can think of that shouldn't make a difference, is I started the scene with a Gaia first person player and changed it to custom later.

 

Screenshot from 2023-10-09 17-20-59.png

Link to comment
Share on other sites

Also, the terrain is imported from another project.  I'm using Gaia 3.4.1 scripts only package instead of the whole thing.  Art and Gaia user settings get imported with the terrain in a custom package. 

Link to comment
Share on other sites

  • Solution

Ok, I fixed it.  Removed Gaia elements from the scene (Tools, Runtime, Terrain).  Removed all Gaia User Data from the assets.  Renamed the scene.  Reimported the scene package, with this exception: in Gaia User Data, I unchecked and did not import Terrain Scenes.  Added all the props back in from the renamed original.  After the Terrain Scenes file rebuilt itself, everything worked perfectly.  

Note I had previously just deleted that file, but it the errors recurred after it rebuilt.  It took removing and reimporting the scene asset and all the user data (minus that file) to make it work.  

 

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