Jump to content

Gena give me a NullRefernceExpection


Go to solution Solved by Nutshell,

Recommended Posts

Posted

Got a nullrefernceExpection:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AssetDatabase.Contains (UnityEngine.Object obj) (at <aec3a143be31489f8782c487d4d86edd>:0)
GeNa.Core.GeNaRiverExtensionEditor.OnEnable () (at Assets/Procedural Worlds/GeNa/Scripts/Editor/Extensions/GeNaRiverExtensionEditor.cs:20)
 

What I did was: 

1. Created 4x4 terrain with Gaia, spwan biomes

2. and under the tab of target scene(one of the tile terrain: Terrain_1_2-xxxx), add Gena instance - Add Spline - Added  couple points - Added river extension to create river

3. I baked the river.

4. I hit play button and decided to delete river, so I delete river and all everything that Gena created.

5. and now, when I hit play, I will get NullReferenceExepction.

--- the issues now is that, even if I delete the current scene. I would also get this error in a different scene( everything was fine before) when I hit play . Strange tho, do not why get how I get error on Secene B but error first occured in Scene A.

image.thumb.png.6c18432dcd3c3757b00f7b7600f8b609.png

 

Posted

Yeah that error is basically saying its GeNa is trying to access something that isn't there. 
You would need to delete GeNa from the scenes. 

Aditional note: 
I would not delete something in playmode that can lead to a ton of issues not just with our tools. 
 

Posted
10 hours ago, Bryan said:

Yeah that error is basically saying its GeNa is trying to access something that isn't there. 
You would need to delete GeNa from the scenes. 

Aditional note: 
I would not delete something in playmode that can lead to a ton of issues not just with our tools. 
 

well, I'm pretty sure that I deleted everything. And there is another secene that never used Gena before also throw this error.

Posted

You could try to bake everything you want to keep and save any custom spawners outside of the project. 
Then remove GeNa Pro completely from the project. 
Then check the scriptable define symbols and remove them if they are still there. 
These can be found in the project settings - player - other. 

Then reimport GeNa Pro. 
Something must of broke really hard to get this to happen although not sure what the cause of it could have been exactly. We will investigate this issue. 

  • Solution
Posted

well, thank you for the help. I think I have found out how to avoid this issue.

Error Disappears:

1. If I delete everything related to Gena on the Hierarchy window, then save the scene

2. close Unity editor, and re-open the project.  

The null reference error are gone on all scenes. And I also found out how this error ocurred.

image.thumb.png.86e6b5572e431301b2846f56db71d83b.png

my workflow was wrong. after 4*4 terrains were created, I should not add Gena(whether river or any spline) under Terrain_2-2-20240607-171659(see attached img). 

If I add Gena under "Island3", I wouldn't get null reference error, but instead will get a cross scene reference not surrported warning( this warnning will gone, if I delete Gena from Hierarchy window after I do not need use Gena anymore. )

Posted

Perfect thank you for updating me! 
Glad its sorted! 

 

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
  • STORM is here!

    STORM supercharges Unity to render massive open AAA worlds—on mobile and desktop—up to 10 times faster.

    STORM is your go-to tool for game makers and studios who are serious about performance and profitability.

  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
×
×
  • Create New...