Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Strange NullReferenceException error in ECS Transform system with no obvious culprit

Discussion in 'Entity Component System and C# Job system' started by bac9-flcl, Dec 6, 2018.

  1. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    722
    We have recently started getting this error but we are unable to find the reason behind it so far:

    Code (csharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3.   at Unity.Entities.EntityDataManager.IncrementComponentOrderVersion (Unity.Entities.Archetype* archetype, Unity.Entities.Chunk* chunk, Unity.Entities.SharedComponentDataManager sharedComponentDataManager) [0x0000c] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Entities\EntityDataManager.cs:1122
    4.   at Unity.Entities.EntityDataManager.SetSharedComponentDataIndex (Unity.Entities.ArchetypeManager archetypeManager, Unity.Entities.SharedComponentDataManager sharedComponentDataManager, Unity.Entities.Entity entity, System.Int32 typeIndex, System.Int32 newSharedComponentDataIndex) [0x0008f] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Entities\EntityDataManager.cs:1111
    5.   at Unity.Entities.EntityManager.SetSharedComponentDataBoxed (Unity.Entities.Entity entity, System.Int32 typeIndex, System.Int32 hashCode, System.Object componentData) [0x0002e] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Entities\EntityManager.cs:581
    6.   at Unity.Entities.EntityCommandBuffer.PlaybackChain (Unity.Entities.EntityManager mgr, Unity.Entities.ECBSharedPlaybackState& playbackState, Unity.Collections.NativeArray`1[T] chainStates, System.Int32 currentChain, System.Int32 nextChain) [0x00489] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Entities\EntityCommandBuffer.cs:1015
    7.   at Unity.Entities.EntityCommandBuffer.Playback (Unity.Entities.EntityManager mgr) [0x00233] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Entities\EntityCommandBuffer.cs:872
    8.   at Unity.Transforms.TransformSystem.UpdateDepth () [0x0010d] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Transforms\TransformSystem.cs:1006
    9.   at Unity.Transforms.TransformSystem.OnUpdate (Unity.Jobs.JobHandle inputDeps) [0x000a1] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Transforms\TransformSystem.cs:1166
    10.   at Unity.Entities.JobComponentSystem.InternalUpdate () [0x0005a] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Entities\ComponentSystem.cs:508
    11.   at Unity.Entities.ScriptBehaviourManager.Update () [0x00001] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Entities\ScriptBehaviourManager.cs:77
    12.   at Unity.Entities.ScriptBehaviourUpdateOrder+DummyDelagateWrapper.TriggerUpdate () [0x00001] in D:\Git\phantombrigade\Library\PackageCache\com.unity.entities@0.0.12-preview.20\Unity.Entities\ScriptBehaviourUpdateOrder.cs:703
    13.  
    14. (Filename: D:/Git/phantombrigade/Library/PackageCache/com.unity.entities@0.0.12-preview.20/Unity.Entities/EntityDataManager.cs Line: 1122)
    What could cause the transform system/entity data manager to trip like that? If I'm not mistaken, the only operations we perform in frames around this error is attachment of Parent data components to some entities, and I don't see how they can cause this.
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    723
    Are you adding static?