Obi Official Forum
Help ArgumentNullException: Value cannot be null. - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help ArgumentNullException: Value cannot be null. (/thread-1426.html)



ArgumentNullException: Value cannot be null. - x1290148 - 16-10-2019

ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
Obi.ObiMeshShapeTracker.UpdateMeshData () (at Assets/Obi/Scripts/Collisions/ColliderTrackers/Trackers3D/ObiMeshShapeTracker.cs:81)
Obi.ObiMeshShapeTracker..ctor (UnityEngine.MeshCollider collider) (at Assets/Obi/Scripts/Collisions/ColliderTrackers/Trackers3D/ObiMeshShapeTracker.cs:59)
Obi.ObiCollider.CreateTracker () (at Assets/Obi/Scripts/Collisions/ObiCollider.cs:75)
Obi.ObiColliderBase.AddCollider () (at Assets/Obi/Scripts/Collisions/ObiColliderBase.cs:133)
Obi.ObiCollider.Awake () (at Assets/Obi/Scripts/Collisions/ObiCollider.cs:112)
UnityEngine.GameObject:SetActive(Boolean)
<WaitFade>d__44:MoveNext() (at Assets/Scripts/BZManager.cs:385)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
HuhIt happened while I was running the game. How do I fix this?


RE: ArgumentNullException: Value cannot be null. - josemendez - 16-10-2019

(16-10-2019, 02:16 AM)x1290148 Wrote: ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
Obi.ObiMeshShapeTracker.UpdateMeshData () (at Assets/Obi/Scripts/Collisions/ColliderTrackers/Trackers3D/ObiMeshShapeTracker.cs:81)
Obi.ObiMeshShapeTracker..ctor (UnityEngine.MeshCollider collider) (at Assets/Obi/Scripts/Collisions/ColliderTrackers/Trackers3D/ObiMeshShapeTracker.cs:59)
Obi.ObiCollider.CreateTracker () (at Assets/Obi/Scripts/Collisions/ObiCollider.cs:75)
Obi.ObiColliderBase.AddCollider () (at Assets/Obi/Scripts/Collisions/ObiColliderBase.cs:133)
Obi.ObiCollider.Awake () (at Assets/Obi/Scripts/Collisions/ObiCollider.cs:112)
UnityEngine.GameObject:SetActive(Boolean)
<WaitFade>d__44:MoveNext() (at Assets/Scripts/BZManager.cs:385)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
HuhIt happened while I was running the game. How do I fix this?

Seems like you destroyed the shared mesh used by a MeshCollider right before instantiating it, since the error is complaining that the sharedMesh in the collider is null (we use it as index in a dictionary during the collider's Awake() to get a reference to its unmanaged counterpart if it exists)

Can you give a bit of context? (what are you trying to achieve in your game? are you using any custom scripts that might affect colliders?)


RE: ArgumentNullException: Value cannot be null. - x1290148 - 18-10-2019

(16-10-2019, 07:01 AM)josemendez Wrote: Seems like you destroyed the shared mesh used by a MeshCollider right before instantiating it, since the error is complaining that the sharedMesh in the collider is null (we use it as index in a dictionary during the collider's Awake() to get a reference to its unmanaged counterpart if it exists)

Can you give a bit of context? (what are you trying to achieve in your game? are you using any custom scripts that might affect colliders?)

Thank you. I just want to click the button and show it. I made a new rope. Fortunately, it didn't make a mistake again.