Jump to content

Null Reference Exception in TerrainHelper.cs and others


Dr.ake

Recommended Posts

@Dr.ake I looked into these errors, and they seem to be caused by a terrain that has no terrain data associated to it. Could you please check if all terrain objects in your scene have a terrain data object assigned? You can do so by switching the inspector to "Debug" mode, selecting the terrain and then checking if a terrain data object is in these slots:

image.png

If the terrain was created by Gaia, the terrain data object is created in the Session Folder in Gaia User Data by default.

Link to comment
Share on other sites

Peter, good effort in finding this out. This is in fact the problem:

4LNry1.jpgspacer.png

I did find the folder with the terrains, but which of the 10 files is the right one to use as terrain data?

Link to comment
Share on other sites

By default the terrain data file has the same name as the terrain itself - it looks like you do not have that terrain data object anymore, there is only a splatmap file (blue icon) with that name. The files in that directory look a bit odd, normally the splatmap should be a child of the terrain data object and named differently, like so:

image.png

It looks like the data in your folder got corrupted somehow - according to the timestamps in the filenames a lot of terrains were created within that session, did anything out of the ordinary happen during terrain creation (e.g. unity crashed)?

Link to comment
Share on other sites

Changes on terrains, e.g. changing the texturing are permanent and detached from saving the scene file. As soon as you are looking into creating a larger project over multiple days, a source control system (git, plastic scm, etc.) is pretty much a must - they allow you to return to an earlier state of your terrains if there is any sort of issue.

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