Jump to content

Terrain Loader Manager Deleting itself


Recommended Posts

Using Gaia Pro 2021 v3.4.1
Unity 2022.3.5f1

On occasion my singleton instance of the Terrain Loader Manager is deleting itself.

I put a debug.log in the Start() of TerrainLoaderManager and it only runs start once, so there should only be one instance.

The only thing I can think is that since the editor uses the Terrain Loader Manager, it's not being set to null when I start the game in the editor on occasion?

wtYCqNK.png

K6QfpQ5.png

directly returning the instance in GetInstantWithoutCreation and the Instance Get fixed the issue but caused other problems since the editor needs the TerrainLoaderManager object.

Any fix for this?

Link to comment
Share on other sites

Hi @AIA,

I have not seen this issue yet so far with the terrain loader manager (assuming there is no bogus 2nd terrain loader manager hidden in the scene somewhere for some reason). It is a bit difficult to analyze what might be going on from a distance, but I have 2 first ideas:

 

  • If you click on the super small magnifying glass icon in the scene hierarchy, it is possible to search "by Type" instead of by name. Could you please enter the exact type name of the class "TerrainLoaderManager" (WITHOUT the quotes) to see all objects that have a terrain loader manager attached to them? Maybe there is another one somewhere that interferes
    image.png 
     
  • Did you see that there is also similar code that would destroy other instances in "OnEnable"? This code should run before Start, so it might be worth to put your debug statements down there as well, my guess is the "winning" object that gets to be the instance does so during "OnEnable", and when the execution arrives in Start for the "legit" Terrain Loader Manager, the instance has already been taken and it deletes itself.
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...