Jump to content

Error when generating new terrain using world designer


soyboygames

Recommended Posts

I'm getting these errors when trying to generate a new terrain with world designer. There is no terrain in the scene but it destroys one previous terrain that I made that's not currently in the scene. I tried deleting Gaia and reinstalling but still getting the same problem. 

 

- Error while exporting terrain from world map, Exception: Destroying any GameObject of a Prefab Asset is not allowed. Stack Trace:   at (wrapper managed-to-native) UnityEngine.Object.DestroyImmediate(UnityEngine.Object,bool)
 

- NullReferenceException: Object reference not set to an instance of an object
Gaia.TerrainDetailOverwriteEditor.OnEnable () (at Assets/Procedural Worlds/Gaia/Scripts/Editor/TerrainDetailOverwriteEditor.cs:38)
 

Link to comment
Share on other sites

Also, when I try to generate a new terrain, it completely erases all the terrain texture data from the previous terrains that I had made which are stored in a separate folder from Gaia User Data folder.

Link to comment
Share on other sites

I am using 2022.1.0b2.2474. I tried using Gaia with a new empty project and was able to generate a terrain without an issue. For some reason, Gaia is not working on my current project.

Link to comment
Share on other sites

2 hours ago, soyboygames said:

2022.1.0b2.2474.

I have no idea what this is? 
If you are using 2022.1.22f1 than this should be fine. 

If you are using a beta version of Unity, than we do not support it. 
We only support official releases. 

For this project you could try to reimport it. 
See if this fixes the issue, you could have a bad import in your current project. 
I would also recommend clearing your Unity Cache as well. 
 

Link to comment
Share on other sites

I updated my Unity to the latest version (2022.1.22f1). Cleared Unity Cache and reimported Gaia, but still getting the same error message. 

Link to comment
Share on other sites

Hi @soyboygames I looked into this a bit, and from the error messages and from the issue of the terrain data disappearing it reads to me like there might potentially be references to the terrains and their terrain data loaded in another asset or in one of your own scripts.
When the world designer creates a new scene, it wipes all the existing terrains in the scene together when confirming this message:

image.png

Normally this should only affect terrains that are present in the currently loaded scenes (both active and inactive). I could however imagine that the API call that we use to find all the terrains (Resources.FindObjectsOfTypeAll()) will also return terrains if they exist as a reference in a script or a scriptable object in the scene.
If such a script references a terrain that is currently not loaded in the scene, I could imagine that it could lead to the exact error messages that you are seeing and also the terrain data disappearing (since the terrains are still found this way and the data could be deleted). 
Do you know whether this could be the case? Do you have any additional assets or scripts in the scene that could hold such references to other terrains? You could further test this theory if the same problem occurs in a fresh, empty scene in the same project as well. 

Link to comment
Share on other sites

  • 1 year later...

I had this same issue and what was causing it was I had a terrain prefab in my project. I simply deleted that prefab and all existing terrain in my project and it fixed the issue.

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