I got a Unity error after I try to add my own 3DTileset from a local directory

Hi my friend,I have tried to add a 3D Tileset from my PC local directory,but I got an error on the unity console window

NullReferenceException: Object reference not set to an instance of an object
Reinterop.ReinteropInitializer.System_Collections_Generic_Dictionary5Hx6c0Eu2sl__zevLSSpjKA_CallGetEnumerator_1B2M2Y8AsgTpgAmY7PhCfg (System.IntPtr thiz) (at Library/PackageCache/com.cesium.unity@0.3.0/Runtime/generated/Reinterop/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:32197)
(wrapper native-to-managed) Reinterop.ReinteropInitializer.System_Collections_Generic_Dictionary5Hx6c0Eu2sl__zevLSSpjKA_CallGetEnumerator_1B2M2Y8AsgTpgAmY7PhCfg(intptr)
Reinterop.ReinteropInitializer+ActionA2lFbwI_1jdffaYu1u_OZgNativeFunction.Invoke (UnityEngine.AsyncOperation obj) (at Library/PackageCache/com.cesium.unity@0.3.0/Runtime/generated/Reinterop/Reinterop.RoslynSourceGenerator/ReinteropInitializer.cs:31811)
UnityEngine.AsyncOperation.InvokeCompletionEvent () (at <28d694a2939e4826992577f826717d3b>:0)

I have tried to fix this problem myself and I found that if I change the cesium-unity-samples-0.2.0 project’s second scene Melbourne Photogrammetry’s URL to my 3DTileset local directory url,I won’t get the error.
Please help me figure out if I set something wrong.
Think you all.

How did you create the new tileset? Did you use the “Cesium” panel to add a blank tileset? Or did you create it manually? My best guess it that perhaps your new tileset isn’t nested inside a CesiumGeoreference?

Hello @Kevin_Ring ,Thank you for your reply.
I’m sure I used the Cesium panel to add a blank tileset,and the new tileset is nested inside the CesiumGeoreference,please check out my screen recording below.
bandicam 2023-03-03 16-38-31-241 00_00_00-00_00_30

Hi @Kevin_Ring ,I’m still trying to fix this issue.
I tried to changed the version of cesium for unity plugin to 0.2.0,it helps.
I used 0.3.0 then I have this issue,maybe new version has some problem.
Best wishes.

Hi @Ember6489,

I confirmed I’m seeing the same issue with Cesium for Unity 0.3.0 as well. I’ve opened an issue on Github to track this bug. Thank you for the report!

Thank you janine.
Really appreciate your help on this.

Hi @Ember6489,

We just released Cesium for Unity 0.3.1 to fix this bug. Let us know if you’re still experiencing any issues.

Hi Janine,I have imported the version of 0.3.1 to my project five hours ago,it works perfect and I haven’t find any issue yet.
Thank you so much.

1 Like