Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ArgumentException: A component with type:BoneIndexOffset has not been added to the entity.

Discussion in 'Entity Component System' started by HeyZoos, May 12, 2020.

  1. HeyZoos

    HeyZoos

    Joined:
    Jul 31, 2016
    Posts:
    50
    How do I troubleshoot this error?

    Code (CSharp):
    1. ArgumentException: A component with type:BoneIndexOffset has not been added to the entity.
    2. Unity.Entities.EntityComponentStore.AssertEntityHasComponent (Unity.Entities.Entity entity, Unity.Entities.ComponentType componentType) (at Library/PackageCache/com.unity.entities@0.5.1-preview.11/Unity.Entities/EntityComponentStoreDebug.cs:233)
    3. Unity.Entities.EntityComponentStore.AssertEntityHasComponent (Unity.Entities.Entity entity, System.Int32 componentType) (at Library/PackageCache/com.unity.entities@0.5.1-preview.11/Unity.Entities/EntityComponentStoreDebug.cs:239)
    4. Unity.Entities.ComponentDataFromEntity`1[T].get_Item (Unity.Entities.Entity entity) (at Library/PackageCache/com.unity.entities@0.5.1-preview.11/Unity.Entities/Iterators/ComponentDataFromEntity.cs:133)
    5. Unity.Rendering.CopySkinnedEntityDataToRenderEntity+IterateSkinnedEntityRefJob.Execute (Unity.Entities.Entity entity, System.Int32 index, Unity.Rendering.SkinnedEntityReference& skinnedEntity, Unity.Rendering.BoneIndexOffsetMaterialProperty& boneIndexOffset) (at Library/PackageCache/com.unity.rendering.hybrid@0.3.3-preview.11/Unity.Rendering.Hybrid/CopySkinnedEntityDataToRenderEntity.cs:27)
    6. Unity.Entities.JobForEachExtensions+JobStruct_Process_ECC`3[T,T0,T1].ExecuteChunk (Unity.Entities.JobForEachExtensions+JobStruct_Process_ECC`3[T,T0,T1]& jobData, System.IntPtr bufferRangePatchData, System.Int32 begin, System.Int32 end, Unity.Entities.ArchetypeChunk* chunks, System.Int32* entityIndices) (at Library/PackageCache/com.unity.entities@0.5.1-preview.11/Unity.Entities/IJobForEach.gen.cs:3893)
    7. Unity.Entities.JobForEachExtensions+JobStruct_Process_ECC`3[T,T0,T1].Execute (Unity.Entities.JobForEachExtensions+JobStruct_Process_ECC`3[T,T0,T1]& jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at Library/PackageCache/com.unity.entities@0.5.1-preview.11/Unity.Entities/IJobForEach.gen.cs:3863)
    It's occurring due to this prefab after it's been converted to an entity.

    upload_2020-5-11_22-31-55.png
     
  2. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Code (CSharp):
    1. using Unity.Entities;
    2. using Unity.Rendering;
    3.  
    4. namespace Game.Systems.Initialization {
    5.     /// <summary>
    6.     /// Suppresses the error: "ArgumentException: A component with type:BoneIndexOffset has not been added to the entity.", until the Unity bug is fixed.
    7.     /// </summary>
    8.     [UpdateInGroup(typeof(InitializationSystemGroup))]
    9.     public class DisableCopySkinnedEntityDataToRenderEntitySystem : ComponentSystem {
    10.         protected override void OnCreate() {
    11.             World.GetOrCreateSystem<CopySkinnedEntityDataToRenderEntity>().Enabled = false;
    12.         }
    13.  
    14.         protected override void OnUpdate() {}
    15.     }
    16. }
    17.  
     
    uygaruncosoft likes this.