Author Topic: Globe inside prefab error  (Read 29 times)

danbg

  • Newbie
  • *
  • Posts: 40
    • View Profile
Globe inside prefab error
« on: June 30, 2020, 09:33:46 AM »
Hello, I'm reordering my project and I'm getting some weird errors with Globe Map if I put it inside a prefab:

ArgumentException: UnpackPrefabInstance must be called with a root Prefab instance GameObject.

Despite the error at first it seems it works, but then there is a lot of "hidden" problems regarding countries' highlight, cursor position, UI...

danbg

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Globe inside prefab error
« Reply #1 on: June 30, 2020, 10:33:18 AM »
In case it helps to find what could be happening (or maybe it's something unrelated):

Whenever I have the scene with the prefab already loaded, the error shows, but it seems to work ok.
But when I load the scene with the prefab dynamically, some things go wrong:
  • Countries' highlighted borders (Surfaces GameObject) is rendered in front of everything (even the UI, nearly like an overlay) and it's offset if the camera is not in FOV 60 (Picture example in 85 with Inverted mode, although it happens not so noticeable in Normal mode too)
  • The Globe sometimes is visible only when you edit the prefab, not the scene. Shaders also don't update sometimes and I get purple textures while editing.
  • I also get other errors: MissingReferenceException: The object of type 'WorldMapGlobe' has been destroyed but you are still trying to access it.   and   Invalid worldAABB. Object is too large or too far away from the origin.
  • Not sure if it's related or not, but sometimes the Globe script doesn't show either. I have to assign the Tag MainCamera to any camera in the same scene, then it shows again and I can untag the camera.
« Last Edit: June 30, 2020, 10:39:20 AM by danbg »

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5832
    • View Profile
Re: Globe inside prefab error
« Reply #2 on: June 30, 2020, 11:10:01 AM »
Do you have a camera tagged as MainCamera?

danbg

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Globe inside prefab error
« Reply #3 on: June 30, 2020, 11:20:56 AM »
Eventually I cannot have the camera of the globe scene tagged as main, because I'm using it for another scene. But in any case, I tried both with the camera in the globe scene both tagged and untagged and nothing changes. I'm using a multidisplay setup, so maybe it's related, but it also happened with a single display setup.

danbg

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Globe inside prefab error
« Reply #4 on: June 30, 2020, 03:14:37 PM »
Ok, I figured out the first issue regarding borders. I feel a bit stupid, it was my fault (I have 7 displays around and 20 layers, and I messed the culling masks)

But the other 3 are still there. I got a bunch of errors in the console and many visualization problems. As a workaround I'm leaving the Globe outside the prefab, but I guess it could be a problem in many cases.